@@ -40,17 +40,28 @@ describe("build test", () => {
4040 cy . url ( ) . should ( "not.contain" , "http://localhost:3000" ) ;
4141 }
4242 } else {
43- cy . contains ( "Sign in to your account" , { timeout : 10000 } ) . should (
44- "exist" ,
45- ) ;
46-
47- cy . contains ( "Forgot password?" ) . click ( ) ;
43+ if ( Cypress . env ( "UI_FRAMEWORK" ) === "shadcn" ) {
44+ cy . contains ( "Sign in" , { timeout : 10000 } ) . should ( "exist" ) ;
45+ } else {
46+ cy . contains ( "Sign in to your account" , {
47+ timeout : 10000 ,
48+ } ) . should ( "exist" ) ;
49+ }
50+ if ( Cypress . env ( "UI_FRAMEWORK" ) === "shadcn" ) {
51+ cy . contains ( "Forgot password" ) . click ( ) ;
52+ } else {
53+ cy . contains ( "Forgot password?" ) . click ( ) ;
54+ }
4855
4956 cy . wait ( 1000 ) ;
5057
5158 cy . url ( ) . should ( "contain" , "/forgot-password" ) ;
5259
53- cy . contains ( "Sign in" ) . click ( ) ;
60+ if ( Cypress . env ( "UI_FRAMEWORK" ) === "shadcn" ) {
61+ cy . contains ( "Back" ) . click ( ) ;
62+ } else {
63+ cy . contains ( "Sign in" ) . click ( ) ;
64+ }
5465
5566 cy . wait ( 1000 ) ;
5667
@@ -62,7 +73,11 @@ describe("build test", () => {
6273
6374 cy . url ( ) . should ( "contain" , "/register" ) ;
6475
65- cy . contains ( "Sign up for your account" ) . should ( "exist" ) ;
76+ if ( Cypress . env ( "UI_FRAMEWORK" ) === "shadcn" ) {
77+ cy . contains ( "Sign up" ) . click ( ) ;
78+ } else {
79+ cy . contains ( "Sign up for your account" ) . should ( "exist" ) ;
80+ }
6681
6782 cy . contains ( "Sign in" ) . click ( ) ;
6883
@@ -72,12 +87,20 @@ describe("build test", () => {
7287 failOnStatusCode : false ,
7388 } ) . wait ( 1000 ) ;
7489
75- cy . url ( ) . should ( "be.oneOf" , [
76- "http://localhost:3000/login?to=%2Fi-dont-exist" ,
77- "http://localhost:3000/login?to=/i-dont-exist" ,
78- ] ) ;
90+ cy . url ( ) . should (
91+ "be.oneOf" ,
92+ [
93+ "http://localhost:3000/login?to=%2Fi-dont-exist" ,
94+ "http://localhost:3000/login?to=/i-dont-exist" ,
95+ ] ,
96+ { timeout : 10000 } ,
97+ ) ;
7998
80- cy . contains ( "Sign in to your account" ) . should ( "exist" ) ;
99+ if ( Cypress . env ( "UI_FRAMEWORK" ) === "shadcn" ) {
100+ cy . contains ( "Sign in" ) . should ( "exist" ) ;
101+ } else {
102+ cy . contains ( "Sign in to your account" ) . should ( "exist" ) ;
103+ }
81104
82105 if (
83106 Cypress . env ( "UI_FRAMEWORK" ) === "no" ||
@@ -92,6 +115,16 @@ describe("build test", () => {
92115 }
93116 }
94117
118+ if ( Cypress . env ( "UI_FRAMEWORK" ) === "shadcn" ) {
119+ if ( Cypress . env ( "DATA_PROVIDER" ) === "supabase" ) {
120+ cy . get ( "#email" ) . type ( "info@refine.dev" ) ;
121+ cy . get ( "input[type='password']" ) . type ( "refine-supabase" ) ;
122+ } else {
123+ cy . get ( "#email" ) . type ( "demo@refine.dev" ) ;
124+ cy . get ( "input[type='password']" ) . type ( "demodemo" ) ;
125+ }
126+ }
127+
95128 cy . wait ( 1000 ) . get ( "form" ) . submit ( ) ;
96129
97130 cy . wait ( 1000 ) ;
@@ -100,11 +133,15 @@ describe("build test", () => {
100133 timeout : 3000 ,
101134 } ) ;
102135
103- cy . contains ( "Sorry, the page you visited does not exist." ) . should (
104- "exist" ,
105- ) ;
106-
107- cy . contains ( "Back Home" ) . click ( ) ;
136+ if ( Cypress . env ( "UI_FRAMEWORK" ) === "shadcn" ) {
137+ cy . contains ( "Page not found." ) . should ( "exist" ) ;
138+ cy . contains ( "Back to homepage" ) . click ( ) ;
139+ } else {
140+ cy . contains (
141+ "Sorry, the page you visited does not exist." ,
142+ ) . should ( "exist" ) ;
143+ cy . contains ( "Back Home" ) . click ( ) ;
144+ }
108145
109146 cy . wait ( 1000 ) ;
110147
@@ -122,7 +159,17 @@ describe("build test", () => {
122159 ) {
123160 cy . contains ( "Categories" ) . should ( "exist" ) ;
124161
125- cy . contains ( "Logout" ) . should ( "exist" ) ;
162+ if ( Cypress . env ( "UI_FRAMEWORK" ) === "shadcn" ) {
163+ // For shadcn, logout is in a dropdown menu
164+ // First click the avatar button to open dropdown
165+ cy . get ( 'button:has([data-slot="avatar"])' ) . click ( ) ;
166+
167+ // Then verify the logout option is visible in the dropdown
168+ cy . contains ( "Logout" ) . should ( "exist" ) ;
169+ } else {
170+ // For other UI frameworks, logout is directly visible
171+ cy . contains ( "Logout" ) . should ( "exist" ) ;
172+ }
126173 }
127174 }
128175 } ) ;
0 commit comments