File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,17 @@ module.exports = defineConfig({
23
23
env : {
24
24
TEST_SCIENTIST_USER :
'[email protected] ' ,
25
25
TEST_SCIENTIST_PW : '!test1234' ,
26
- NEXT_PUBLIC_PROVIDER_NAME : 'acme' ,
27
- NEXT_PUBLIC_PROVIDER_ID : '572'
26
+ NEXT_PUBLIC_PROVIDER_NAME : process . env . NEXT_PUBLIC_PROVIDER_NAME ,
27
+ NEXT_PUBLIC_PROVIDER_ID : process . env . NEXT_PUBLIC_PROVIDER_ID ,
28
+ NEXT_PUBLIC_TOKEN : process . env . NEXT_PUBLIC_TOKEN ,
29
+ // importing the `API_PER_PAGE` variable from the constants file throws
30
+ // errors since this file doesn't follow ES6 syntax. if the value is
31
+ // changed in constants, it needs to be updated here too
32
+ API_PER_PAGE : 2000 ,
28
33
} ,
29
34
reporter : 'junit' ,
30
35
reporterOptions : {
31
36
mochaFile : 'cypress/results/results-[hash].xml' ,
32
37
toConsole : true ,
33
38
} ,
34
- } ) ;
39
+ } )
Original file line number Diff line number Diff line change @@ -5,11 +5,10 @@ describe('Viewing Home page', () => {
5
5
let featuredServices
6
6
7
7
beforeEach ( ( ) => {
8
- // Intercept the response from the endpoint to view all requests
9
8
cy . customApiIntercept ( {
10
9
action : 'GET' ,
11
10
alias : 'useAllWares' ,
12
- requestURL : `/providers/ ${ Cypress . env ( 'NEXT_PUBLIC_PROVIDER_ID ' ) } /wares.json ` ,
11
+ requestURL : `/wares.json?per_page= ${ Cypress . env ( 'API_PER_PAGE ' ) } ` ,
13
12
data : featuredServices ,
14
13
defaultFixture : 'services/wares.json' ,
15
14
emptyFixture : 'services/no-wares.json' ,
@@ -19,13 +18,11 @@ describe('Viewing Home page', () => {
19
18
cy . visit ( '/' )
20
19
} )
21
20
22
-
23
21
context ( 'featured services list is loading' , ( ) => {
24
- before ( ( ) => {
25
- loading = true
26
- } )
22
+ before ( ( ) => loading = true )
23
+
27
24
it ( 'should show 3 placeholder cards loading' , ( ) => {
28
- cy . get ( 'p.placeholder-glow' ) . should ( 'be.visible' ) . then ( ( ) => {
25
+ cy . get ( 'p.placeholder-glow' ) . should ( 'have.length' , 3 ) . then ( ( ) => {
29
26
cy . log ( 'Loading text displays correctly.' )
30
27
} )
31
28
} )
You can’t perform that action at this time.
0 commit comments