|
1 | 1 | 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) { |
4 | 3 | browser
|
5 | 4 | .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') |
11 | 7 | },
|
12 | 8 |
|
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) { |
14 | 10 | browser
|
15 | 11 | .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 | + }) |
21 | 22 | },
|
22 | 23 |
|
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) { |
24 | 25 | browser
|
25 | 26 | .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"]') |
28 | 33 | .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 | + }) |
31 | 41 | },
|
32 |
| - |
33 |
| - 'Public domain pop up redirects to https://creativecommons.org/publicdomain/': function(browser) { |
| 42 | + 'Check if "What do the Icons Mean?" modal is working fine': function(browser) { |
34 | 43 | browser
|
35 | 44 | .init()
|
36 |
| - .assert.elementPresent('#public_domain_btn') |
37 |
| - .click('#public_domain_btn') |
| 45 | + .assert.elementPresent('ul > li:nth-child(3) > a') |
| 46 | + .click('ul > li:nth-child(3) > a') |
| 47 | + .assert.elementPresent('.modal-content') |
| 48 | + .assert.elementPresent('header[class="modal-card-head"]') |
| 49 | + .assert.elementPresent('.modal-card-body') |
| 50 | + .assert.elementPresent('.edu-icons-title-section img') |
| 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 | + }) |
38 | 56 | .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 | + }) |
41 | 60 | },
|
42 | 61 |
|
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) { |
44 | 63 | browser
|
45 | 64 | .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"]') |
48 | 70 | .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 | + }) |
51 | 82 | },
|
52 | 83 |
|
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) { |
54 | 85 | browser
|
55 | 86 | .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') |
61 | 93 | },
|
62 | 94 |
|
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) { |
64 | 96 | browser
|
65 | 97 | .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('div[class="column"] img') |
| 104 | + .assert.elementPresent('footer[class="modal-card-foot"]') |
| 105 | + .assert.elementPresent('.modal-card-foot p a') |
| 106 | + .getAttribute('.modal-card-foot p a', 'href', function(result) { |
| 107 | + this.assert.equal(result.value, 'https://creativecommons.org/share-your-work/licensing-types-examples/') |
| 108 | + }) |
| 109 | + }, |
| 110 | + |
| 111 | + 'Check if "How are Licenses Communicated?" modal is working fine': function(browser) { |
| 112 | + browser |
| 113 | + .init() |
| 114 | + .assert.elementPresent('ul > li:nth-child(7) > a') |
| 115 | + .click('ul > li:nth-child(7) > a') |
| 116 | + .assert.elementPresent('.modal-content') |
| 117 | + .assert.elementPresent('header[class="modal-card-head"]') |
| 118 | + .assert.elementPresent('.modal-card-body') |
| 119 | + .assert.elementPresent('.help-section__table') |
| 120 | + .assert.elementPresent('.photo-license-icons img') |
71 | 121 | },
|
72 | 122 |
|
73 |
| - 'License types pop up redirects to https://creativecommons.org/share-your-work/licensing-types-examples/': function(browser) { |
| 123 | + 'Check if "What is a Free Culture License?" modal is working fine': function(browser) { |
74 | 124 | browser
|
75 | 125 | .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/') |
| 126 | + .assert.elementPresent('ul > li:nth-child(8) > a') |
| 127 | + .click('ul > li:nth-child(8) > a') |
| 128 | + .assert.elementPresent('.modal-content') |
| 129 | + .assert.elementPresent('header[class="modal-card-head"]') |
| 130 | + .assert.elementPresent('.modal-card-body') |
| 131 | + .assert.elementPresent('footer[class="modal-card-foot"]') |
| 132 | + .assert.elementPresent('p[class="help-text"] a') |
| 133 | + .getAttribute('p[class="help-text"] a', 'href', function(result) { |
| 134 | + this.assert.equal(result.value, 'https://freedomdefined.org/Definition') |
| 135 | + }) |
| 136 | + .assert.elementPresent('footer[class="modal-card-foot"] p a') |
| 137 | + .getAttribute('footer[class="modal-card-foot"] p a', 'href', function(result) { |
| 138 | + this.assert.equal(result.value, 'https://creativecommons.org/share-your-work/public-domain/freeworks') |
| 139 | + }) |
81 | 140 | }
|
82 | 141 | }
|
0 commit comments