Skip to content

Commit fdadfe6

Browse files
committed
Modified and added some e2e tests for LicenseCode.vue
1 parent 482f6b3 commit fdadfe6

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

tests/e2e/specs/LicenseCode.js

+20-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22

3-
'Check if the main p tag with the class license-text is present': function(browser) {
3+
'Check if the p-tag with the class license-text is present': function(browser) {
44
browser
55
.init()
66
.assert.elementPresent('.control-label > span')
@@ -14,11 +14,28 @@ module.exports = {
1414
.click('.pagination-next')
1515
.assert.elementPresent('p[class="license-text"]')
1616
},
17-
'Check if the a tag in the "Rich Text" redirects to https://creativecommons.org/licenses/by-sa/4.0/?ref=ccchooser': function(browser) {
17+
'Check if the links in the license code redirects properly': function(browser) {
1818
browser
19+
.setValue('input[placeholder="Jane Doe"]', 'Jane Doe')
20+
.setValue('input[placeholder="www.author.com"]', 'www.author.com')
21+
.setValue('input[placeholder="This work"]', 'This work')
22+
.setValue('input[placeholder="www.author.com/work.jpg"]', 'www.author.com/work.jpg')
1923
.assert.elementPresent('p[class="license-text"] a')
20-
.getAttribute('p[class="license-text"] a', 'href', function(result) {
24+
.getAttribute('p > span > a:nth-child(1)', 'href', function(result) {
25+
this.assert.equal(result.value, 'http://localhost:8080/www.author.com/work.jpg')
26+
})
27+
.getAttribute('p > span > a:nth-child(2)', 'href', function(result) {
28+
this.assert.equal(result.value, 'http://localhost:8080/www.author.com')
29+
})
30+
.getAttribute('p > span > a:nth-child(4)', 'href', function(result) {
2131
this.assert.equal(result.value, 'https://creativecommons.org/licenses/by-sa/4.0/?ref=ccchooser')
2232
})
33+
},
34+
'Check if the text is displayed under the print attribution': function(browser) {
35+
browser
36+
.click('nav > ul > li:nth-child(2) > a')
37+
.assert.elementPresent('p[class="license-text"]')
38+
.assert.elementPresent('#attribution-text > p > span:nth-child(1)')
39+
.assert.elementPresent('#attribution-text > p > span:nth-child(2)')
2340
}
2441
}

0 commit comments

Comments
 (0)