Skip to content

Commit a6dadc3

Browse files
committed
Added e2e tests for HelpSection.vue
1 parent cd1d995 commit a6dadc3

File tree

1 file changed

+103
-46
lines changed

1 file changed

+103
-46
lines changed

tests/e2e/specs/HelpSection.js

Lines changed: 103 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,139 @@
11
module.exports = {
2-
3-
'Common license pop up redirects to https://creativecommons.org/licenses/': function(browser) {
2+
'Check if the Help Section is rendered in the DOM': function(browser) {
43
browser
54
.init()
6-
.assert.elementPresent('#cc_license_btn')
7-
.click('#cc_license_btn')
8-
.assert.elementPresent('#license_link')
9-
.click('#license_link')
10-
.assert.urlEquals('https://creativecommons.org/licenses/')
5+
.assert.elementPresent('.help-section')
6+
.assert.elementPresent('.h3a')
117
},
128

13-
'How do licenses work pop up redirects to https://creativecommons.org/licenses/': function(browser) {
9+
'Check if "What Are Creative Commons Licenses?" modal is working fine': function(browser) {
1410
browser
1511
.init()
16-
.assert.elementPresent('#license_work_btn')
17-
.click('#license_work_btn')
18-
.assert.elementPresent('#license_link_2')
19-
.click('#license_link_2')
20-
.assert.urlEquals('https://creativecommons.org/licenses/')
12+
.assert.elementPresent('ul > li:nth-child(1) > a')
13+
.click('ul > li:nth-child(1) > a')
14+
.assert.elementPresent('.modal-content')
15+
.assert.elementPresent('header[class="modal-card-head"]')
16+
.assert.elementPresent('.help-text')
17+
.assert.elementPresent('footer[class="modal-card-foot"]')
18+
.assert.elementPresent('#license_link')
19+
.getAttribute('#license_link', 'href', function(result) {
20+
this.assert.equal(result.value, 'https://creativecommons.org/licenses/')
21+
})
2122
},
2223

23-
'How do licenses work pop up redirects to https://wiki.creativecommons.org/wiki/CC_REL': function(browser) {
24+
'Check if "How do the Licenses Work?" modal is working fine': function(browser) {
2425
browser
2526
.init()
26-
.assert.elementPresent('#license_work_btn')
27-
.click('#license_work_btn')
27+
.assert.elementPresent('ul > li:nth-child(2) > a')
28+
.click('ul > li:nth-child(2) > a')
29+
.assert.elementPresent('.modal-content')
30+
.assert.elementPresent('header[class="modal-card-head"]')
31+
.assert.elementPresent('.help-text')
32+
.assert.elementPresent('footer[class="modal-card-foot"]')
2833
.assert.elementPresent('#cc_rights_link')
29-
.click('#cc_rights_link')
30-
.assert.urlEquals('https://wiki.creativecommons.org/wiki/CC_REL')
34+
.getAttribute('#cc_rights_link', 'href', function(result) {
35+
this.assert.equal(result.value, 'https://wiki.creativecommons.org/Ccrel')
36+
})
37+
.assert.elementPresent('#license_link_2')
38+
.getAttribute('#license_link_2', 'href', function(result) {
39+
this.assert.equal(result.value, 'https://creativecommons.org/licenses/')
40+
})
3141
},
3242

33-
'Public domain pop up redirects to https://creativecommons.org/publicdomain/': function(browser) {
43+
'Check if "What do the Icons Mean?" modal is working fine': function(browser) {
3444
browser
3545
.init()
36-
.assert.elementPresent('#public_domain_btn')
37-
.click('#public_domain_btn')
46+
.assert.elementPresent('ul > li:nth-child(3) > a')
47+
.click('ul > li:nth-child(3) > a')
48+
.assert.elementPresent('.modal-content')
49+
.assert.elementPresent('header[class="modal-card-head"]')
50+
.assert.elementPresent('.modal-card-body')
51+
.assert.elementPresent('footer[class="modal-card-foot"]')
52+
.assert.elementPresent('.help a')
53+
.getAttribute('.help a', 'href', function(result) {
54+
this.assert.equal(result.value, 'https://wiki.creativecommons.org/wiki/NonCommercial_interpretation')
55+
})
3856
.assert.elementPresent('#domain_link')
39-
.click('#domain_link')
40-
.assert.urlEquals('https://creativecommons.org/publicdomain/')
57+
.getAttribute('#domain_link', 'href', function(result) {
58+
this.assert.equal(result.value, 'https://creativecommons.org/publicdomain/')
59+
})
4160
},
4261

43-
'License consideration pop up redirects to https://wiki.creativecommons.org/wiki/Considerations_for_licensors_and_licensees#Considerations_for_licensors': function(browser) {
62+
'Check if "Considerations Before Licensing" modal is working fine': function(browser) {
4463
browser
4564
.init()
46-
.assert.elementPresent('#consideration_btn')
47-
.click('#consideration_btn')
65+
.assert.elementPresent('ul > li:nth-child(4) > a')
66+
.click('ul > li:nth-child(4) > a')
67+
.assert.elementPresent('.modal-content')
68+
.assert.elementPresent('header[class="modal-card-head"]')
69+
.assert.elementPresent('footer[class="modal-card-foot"]')
4870
.assert.elementPresent('#licensors_link')
49-
.click('#licensors_link')
50-
.assert.urlEquals('https://wiki.creativecommons.org/wiki/Considerations_for_licensors_and_licensees#Considerations_for_licensors')
71+
.getAttribute('#licensors_link', 'href', function(result) {
72+
this.assert.equal(result.value, 'https://wiki.creativecommons.org/wiki/Considerations_for_licensors_and_licensees#Considerations_for_licensors')
73+
})
74+
.assert.elementPresent('#licensees_link')
75+
.getAttribute('#licensees_link', 'href', function(result) {
76+
this.assert.equal(result.value, 'https://wiki.creativecommons.org/wiki/Considerations_for_licensors_and_licensees#Considerations_for_licensees')
77+
})
78+
.assert.elementPresent('#wiki_link')
79+
.getAttribute('#wiki_link', 'href', function(result) {
80+
this.assert.equal(result.value, 'https://wiki.creativecommons.org/wiki/Before_Licensing')
81+
})
5182
},
5283

53-
'License consideration pop up redirects to https://wiki.creativecommons.org/wiki/Considerations_for_licensors_and_licensees#Considerations_for_licensees': function(browser) {
84+
'Check if "How do I Formally License my Work?" modal is working fine': function(browser) {
5485
browser
5586
.init()
56-
.assert.elementPresent('#consideration_btn')
57-
.click('#consideration_btn')
58-
.assert.elementPresent('#licensees_link')
59-
.click('#licensees_link')
60-
.assert.urlEquals('https://wiki.creativecommons.org/wiki/Considerations_for_licensors_and_licensees#Considerations_for_licensees')
87+
.assert.elementPresent('ul > li:nth-child(5) > a')
88+
.click('ul > li:nth-child(5) > a')
89+
.assert.elementPresent('.modal-content')
90+
.assert.elementPresent('header[class="modal-card-head"]')
91+
.assert.elementPresent('.modal-card-body')
92+
.assert.elementPresent('article')
6193
},
6294

63-
'License consideration pop up redirects to https://wiki.creativecommons.org/wiki/Considerations_for_licensors_and_licensees': function(browser) {
95+
'Check if "The Six Creative Commons Licenses" modal is working fine': function(browser) {
6496
browser
6597
.init()
66-
.assert.elementPresent('#consideration_btn')
67-
.click('#consideration_btn')
68-
.assert.elementPresent('#wiki_link')
69-
.click('#wiki_link')
70-
.assert.urlEquals('https://wiki.creativecommons.org/wiki/Considerations_for_licensors_and_licensees')
98+
.assert.elementPresent('ul > li:nth-child(6) > a')
99+
.click('ul > li:nth-child(6) > a')
100+
.assert.elementPresent('.modal-content')
101+
.assert.elementPresent('header[class="modal-card-head"]')
102+
.assert.elementPresent('.modal-card-body')
103+
.assert.elementPresent('footer[class="modal-card-foot"]')
104+
.assert.elementPresent('.modal-card-foot p a')
105+
.getAttribute('.modal-card-foot p a', 'href', function(result) {
106+
this.assert.equal(result.value, 'https://creativecommons.org/share-your-work/licensing-types-examples/')
107+
})
108+
},
109+
110+
'Check if "How are Licenses Communicated?" modal is working fine': function(browser) {
111+
browser
112+
.init()
113+
.assert.elementPresent('ul > li:nth-child(7) > a')
114+
.click('ul > li:nth-child(7) > a')
115+
.assert.elementPresent('.modal-content')
116+
.assert.elementPresent('header[class="modal-card-head"]')
117+
.assert.elementPresent('.modal-card-body')
118+
.assert.elementPresent('.help-section__table')
71119
},
72120

73-
'License types pop up redirects to https://creativecommons.org/share-your-work/licensing-types-examples/': function(browser) {
121+
'Check if "What is a Free Culture License?" modal is working fine': function(browser) {
74122
browser
75123
.init()
76-
.assert.elementPresent('#license_description_btn')
77-
.click('#license_description_btn')
78-
.assert.elementPresent('#licensing_examples_link')
79-
.click('#licensing_examples_link')
80-
.assert.urlEquals('https://creativecommons.org/share-your-work/licensing-examples/')
124+
.assert.elementPresent('ul > li:nth-child(8) > a')
125+
.click('ul > li:nth-child(8) > a')
126+
.assert.elementPresent('.modal-content')
127+
.assert.elementPresent('header[class="modal-card-head"]')
128+
.assert.elementPresent('.modal-card-body')
129+
.assert.elementPresent('footer[class="modal-card-foot"]')
130+
.assert.elementPresent('p[class="help-text"] a')
131+
.getAttribute('p[class="help-text"] a', 'href', function(result) {
132+
this.assert.equal(result.value, 'https://freedomdefined.org/Definition')
133+
})
134+
.assert.elementPresent('footer[class="modal-card-foot"] p a')
135+
.getAttribute('footer[class="modal-card-foot"] p a', 'href', function(result) {
136+
this.assert.equal(result.value, 'https://creativecommons.org/share-your-work/public-domain/freeworks')
137+
})
81138
}
82139
}

0 commit comments

Comments
 (0)