1
1
import path from "path" ;
2
- import cities from "../../config/city-lists.json"
2
+ import cities from "../../config/city-lists.json" ;
3
3
4
4
describe ( "Landing Page Tests" , ( ) => {
5
5
beforeEach ( ( ) => {
6
6
cy . visit ( "/" ) ;
7
7
} ) ;
8
+
8
9
it ( "Contains correct heading" , ( ) => {
9
10
const Year = new Date ( ) . getFullYear ( ) ;
10
- cy . getTestData ( "landing-heading" ) . contains ( `AsyncAPI Conf On Tour ${ Year } ` ) ;
11
+ cy . getTestData ( "landing-heading" ) . contains ( new RegExp ( `AsyncAPI Conf On Tour ( ${ Year } | ${ Year - 1 } )` ) ) ;
11
12
} ) ;
12
13
13
14
it ( "Should contain About Section" , ( ) => {
14
15
cy . getTestData ( "about-section" ) . should ( "be.visible" ) ;
15
16
} ) ;
16
17
17
18
it ( "Verify the downloaded file" , ( ) => {
19
+ const Year = new Date ( ) . getFullYear ( ) ;
18
20
cy . getTestData ( "prospectus-download" ) . should ( "be.visible" ) ;
19
21
cy . getTestData ( "prospectus-download" ) . click ( ) ;
20
22
21
- const Year = new Date ( ) . getFullYear ( ) ;
22
23
const downloadsFolder = Cypress . config ( "downloadsFolder" ) ;
23
- cy . readFile ( path . join ( downloadsFolder , `conf ${ Year } .pdf` ) ) ;
24
+ cy . readFile ( path . join ( downloadsFolder , `conf ${ Year } .pdf` ) ) . should ( "exist" ) ;
24
25
} ) ;
25
26
26
27
it ( "Should contain Speakers section" , ( ) => {
@@ -37,21 +38,20 @@ describe("Landing Page Tests", () => {
37
38
38
39
it ( "Should contain logos in Sponsor component" , ( ) => {
39
40
const eventSponsors = cities [ 0 ] . sponsors . eventSponsors ;
40
-
41
- const financialSponsor = cities [ 0 ] . sponsors . financialSponsors ;
41
+ const financialSponsors = cities [ 0 ] . sponsors . financialSponsors ;
42
42
43
43
eventSponsors . forEach ( ( sponsor ) => {
44
- cy . getTestData ( ' sponsor-section' )
44
+ cy . getTestData ( " sponsor-section" )
45
45
. find ( `img[src="${ sponsor . image } "]` )
46
- . should ( ' be.visible' ) ;
47
- cy . get ( `a[href="${ sponsor . websiteUrl } "]` ) . should ( ' exist' ) ;
46
+ . should ( " be.visible" ) ;
47
+ cy . get ( `a[href="${ sponsor . websiteUrl } "]` ) . should ( " exist" ) ;
48
48
} ) ;
49
49
50
- financialSponsor . forEach ( ( sponsor ) => {
51
- cy . getTestData ( ' sponsor-section' )
50
+ financialSponsors . forEach ( ( sponsor ) => {
51
+ cy . getTestData ( " sponsor-section" )
52
52
. find ( `img[src="${ sponsor . image } "]` )
53
- . should ( ' be.visible' ) ;
54
- cy . get ( `a[href="${ sponsor . websiteUrl } "]` ) . should ( ' exist' ) ;
53
+ . should ( " be.visible" ) ;
54
+ cy . get ( `a[href="${ sponsor . websiteUrl } "]` ) . should ( " exist" ) ;
55
55
} ) ;
56
56
} ) ;
57
57
0 commit comments