@@ -11,36 +11,36 @@ test.describe('Footer kotlin ecosystem buttons', () => {
11
11
} ) ;
12
12
13
13
test ( 'Contributing to Kotlin button should navigate to Contributing page' , async ( { page } ) => {
14
- const contributingButton = page . getByRole ( 'link' , { name : 'Contributing to Kotlin' } ) ;
14
+ const contributingButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Contributing to Kotlin' } ) ;
15
15
await expect ( contributingButton ) . toBeVisible ( ) ;
16
16
await contributingButton . click ( ) ;
17
17
await expect ( page . url ( ) ) . toContain ( '/docs/contribute.html' ) ;
18
18
} ) ;
19
19
20
20
test ( 'Releases button should navigate to Releases page' , async ( { page } ) => {
21
- const releasesButton = page . getByRole ( 'link' , { name : 'Releases' } ) ;
21
+ const releasesButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Releases' } ) ;
22
22
await expect ( releasesButton ) . toBeVisible ( ) ;
23
23
await releasesButton . click ( ) ;
24
24
await expect ( page . url ( ) ) . toContain ( '/releases.html' ) ;
25
25
} ) ;
26
26
27
27
// Without click on the button, but it checks that the button contains the right link. Playwright can't check the PDF.
28
28
test ( 'Press Kit button should navigate to Press Kit page' , async ( { page } ) => {
29
- const pressKitButton = page . getByRole ( 'link' , { name : 'Press Kit' } ) ;
29
+ const pressKitButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Press Kit' } ) ;
30
30
await expect ( pressKitButton ) . toBeVisible ( ) ;
31
31
const href = await pressKitButton . getAttribute ( 'href' ) ;
32
32
expect ( href ) . toBe ( 'https://kotlinlang.org/assets/kotlin-media-kit.pdf' ) ;
33
33
} ) ;
34
34
35
35
test ( 'Security button should navigate to Security page' , async ( { page } ) => {
36
- const securityButton = page . getByRole ( 'link' , { name : 'Security' } ) ;
36
+ const securityButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Security' } ) ;
37
37
await expect ( securityButton ) . toBeVisible ( ) ;
38
38
await securityButton . click ( ) ;
39
39
await expect ( page . url ( ) ) . toContain ( '/security.html' ) ;
40
40
} ) ;
41
41
42
42
test ( 'Blog button should navigate to Kotlin Blog page' , async ( { page, context } ) => {
43
- const blogButton = page . getByRole ( 'link' , { name : 'Blog' } ) . last ( ) ;
43
+ const blogButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Blog' } ) ;
44
44
await expect ( blogButton ) . toBeVisible ( ) ;
45
45
const pagePromise = context . waitForEvent ( 'page' ) ;
46
46
await blogButton . click ( ) ;
@@ -50,7 +50,7 @@ test.describe('Footer kotlin ecosystem buttons', () => {
50
50
} ) ;
51
51
52
52
test ( 'Issue Tracker button should navigate to the YouTrack page' , async ( { page, context } ) => {
53
- const issueTrackerButton = page . getByRole ( 'link' , { name : 'Issue Tracker' } ) ;
53
+ const issueTrackerButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Issue Tracker' } ) ;
54
54
await expect ( issueTrackerButton ) . toBeVisible ( ) ;
55
55
const newPagePromise = context . waitForEvent ( 'page' ) ;
56
56
await issueTrackerButton . click ( ) ;
@@ -60,7 +60,7 @@ test.describe('Footer kotlin ecosystem buttons', () => {
60
60
} ) ;
61
61
62
62
test ( 'Brand Assets button should navigate to Brand Assets page' , async ( { page, context } ) => {
63
- const brandAssetsButton = page . getByRole ( 'link' , { name : 'Brand Assets' } ) ;
63
+ const brandAssetsButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Brand Assets' } ) ;
64
64
await expect ( brandAssetsButton ) . toBeVisible ( ) ;
65
65
const newPagePromise = context . waitForEvent ( 'page' ) ;
66
66
await brandAssetsButton . click ( ) ;
@@ -70,7 +70,7 @@ test.describe('Footer kotlin ecosystem buttons', () => {
70
70
} ) ;
71
71
72
72
test ( 'Careers button should navigate to Careers page' , async ( { page, context } ) => {
73
- const careersButton = page . getByRole ( 'link' , { name : 'Careers' } ) ;
73
+ const careersButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Careers' } ) ;
74
74
await expect ( careersButton ) . toBeVisible ( ) ;
75
75
const newPagePromise = context . waitForEvent ( 'page' ) ;
76
76
await careersButton . click ( ) ;
@@ -80,7 +80,7 @@ test.describe('Footer kotlin ecosystem buttons', () => {
80
80
} ) ;
81
81
82
82
test ( 'Kotlin Merch button should navigate to Kotlin Merch page' , async ( { page, context } ) => {
83
- const kotlinMerchButton = page . getByRole ( 'link' , { name : 'Kotlin Merch' } ) ;
83
+ const kotlinMerchButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Kotlin Merch' } ) ;
84
84
await expect ( kotlinMerchButton ) . toBeVisible ( ) ;
85
85
const newPagePromise = context . waitForEvent ( 'page' ) ;
86
86
await kotlinMerchButton . click ( ) ;
@@ -90,7 +90,7 @@ test.describe('Footer kotlin ecosystem buttons', () => {
90
90
} ) ;
91
91
92
92
test ( 'Opt-Out button should navigate to Opt-Out page' , async ( { page } ) => {
93
- const optOutButton = page . getByRole ( 'link' , { name : 'Opt-Out' } ) ;
93
+ const optOutButton = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Opt-Out' } ) ;
94
94
await expect ( optOutButton ) . toBeVisible ( ) ;
95
95
await optOutButton . click ( ) ;
96
96
const cookieSettingsPopup = page . locator ( '#ch2-settings-dialog' ) ;
@@ -100,7 +100,7 @@ test.describe('Footer kotlin ecosystem buttons', () => {
100
100
101
101
// Click on the JetBrains logo button in footer.
102
102
test ( 'JetBrains logo button should navigate to JetBrains homepage' , async ( { page, context } ) => {
103
- const jetBrainsLink = page . getByRole ( 'link' , { name : 'JetBrains ' } ) . nth ( 3 ) ;
103
+ const jetBrainsLink = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'jetbrains.com link ' } ) ;
104
104
await expect ( jetBrainsLink ) . toBeVisible ( ) ;
105
105
const newPagePromise = context . waitForEvent ( 'page' ) ;
106
106
await jetBrainsLink . click ( ) ;
@@ -111,7 +111,7 @@ test.describe('Footer kotlin ecosystem buttons', () => {
111
111
112
112
// Click on the last JetBrains link on the page. It's here: "Supported and developed by JetBrains."
113
113
test ( 'JetBrains link should navigate to JetBrains homepage' , async ( { page, context } ) => {
114
- const jetBrainsLink = page . getByRole ( 'link' , { name : 'JetBrains' } ) . last ( ) ;
114
+ const jetBrainsLink = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'JetBrains' } ) . last ( ) ;
115
115
await expect ( jetBrainsLink ) . toBeVisible ( ) ;
116
116
const newPagePromise = context . waitForEvent ( 'page' ) ;
117
117
await jetBrainsLink . click ( ) ;
@@ -121,15 +121,15 @@ test.describe('Footer kotlin ecosystem buttons', () => {
121
121
} ) ;
122
122
123
123
test ( 'Kotlin Foundation link should navigate to Kotlin Foundation homepage' , async ( { page } ) => {
124
- const kotlinFoundationLink = page . getByRole ( 'link' , { name : 'Kotlin Foundation' } ) . last ( ) ;
124
+ const kotlinFoundationLink = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Kotlin Foundation' } ) ;
125
125
await expect ( kotlinFoundationLink ) . toBeVisible ( ) ;
126
126
await kotlinFoundationLink . click ( ) ;
127
127
await page . waitForLoadState ( ) ;
128
128
await expect ( page . url ( ) ) . toContain ( 'https://kotlinfoundation.org/' ) ;
129
129
} ) ;
130
130
131
131
test ( 'Apache 2 license link should navigate to related page on GitHub' , async ( { page, context } ) => {
132
- const apacheLicenseLink = page . getByRole ( 'link' , { name : 'Apache 2 license' } ) ;
132
+ const apacheLicenseLink = page . getByTestId ( 'footer' ) . getByRole ( 'link' , { name : 'Apache 2 license' } ) ;
133
133
await expect ( apacheLicenseLink ) . toBeVisible ( ) ;
134
134
const newPagePromise = context . waitForEvent ( 'page' ) ;
135
135
await apacheLicenseLink . click ( ) ;
0 commit comments