Skip to content

Added unit and e2e tests for the LicenseCode.vue component #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added tests for the text under the 'Plain Text'
  • Loading branch information
hemanth-hk committed Mar 14, 2020
commit e718e8037631ceea69a9d326e8df4bfce308cc70
22 changes: 22 additions & 0 deletions tests/e2e/specs/LicenseCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,27 @@ module.exports = {
.assert.elementPresent('p[class="license-text"]')
.assert.elementPresent('#attribution-text > p > span:nth-child(1)')
.assert.elementPresent('#attribution-text > p > span:nth-child(2)')
},

// Tests for the text under the "Plain Text"

'Check if the work in plain text is displayed': function(browser) {
browser
.click('nav > ul > li:nth-child(2) > a')
.expect.element('#attribution-text > p > span:nth-child(1) > span:nth-child(1)').text.to.equal('This work')
},
'Check if the license in plain text is displayed': function(browser) {
browser
.expect.element('#attribution-text > p > span:nth-child(1) > span:nth-child(4)').text.to.equal('CC BY-SA 4.0')
},
'Check if the author-name in plain text is displayed': function(browser) {
browser
.expect.element('#attribution-text > p > span:nth-child(1) > span:nth-child(2) > span').text.to.equal('Jane Doe')
},
'Check if the license-details in plain text are displayed': function(browser) {
browser
.click('nav > ul > li:nth-child(2) > a')
.assert.elementPresent('#attribution-text > p > span:nth-child(2)')
.expect.element('#attribution-text > p > span:nth-child(2)').text.to.equal('. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0')
}
}