Skip to content

Commit 63e1894

Browse files
authored
Merge branch 'master' into bg-first-step-unit
2 parents 922c8bb + 179da4e commit 63e1894

20 files changed

+1814
-1011
lines changed

src/components/DropdownStep.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default {
3737
},
3838
methods: {
3939
updateSelected() {
40-
this.$emit('input', 'DD', this.$props.stepId, true)
40+
this.$emit('change', 'DD', this.$props.stepId, true)
4141
}
4242
}
4343
}

src/components/LicenseCode.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
<span v-if="!workTitle">{{ $t('license-use.richtext.workTitle') }}</span>
1818
<span
1919
v-else
20-
rel="dc:title"
20+
rel="dct:title"
2121
>
2222
{{ workTitle }}
2323
</span>
2424
</a>
2525
<span
2626
v-else-if="workTitle"
27-
rel="dc:title"
27+
rel="dct:title"
2828
>
2929
{{ workTitle }}
3030
</span>

src/components/LocaleChooser.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ export default {
6161
width: 100%;
6262
}
6363
.locale-chooser-field .control .select select {
64-
padding-left:2.5em;
64+
padding-left: 2.5em;
65+
z-index: -1;
6566
}
6667
.locale-chooser-field .control .select::before {
6768
content: url("../assets/language.png");
6869
position: absolute;
69-
z-index: 1;
7070
left:10px;
7171
top:8px;
7272
}

src/components/Stepper.vue

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div
44
v-for="(step, idx) in visibleSteps()"
55
:key="idx"
6-
:class="['step-container', step.status, enabledQualifier(step.enabled)]"
6+
:class="['step-container', step.name, step.status, enabledQualifier(step.enabled)]"
77
>
88
<div
99
:class="['step-header']"
@@ -43,7 +43,7 @@
4343
v-else-if="step.status!=='inactive' && step.name==='DD'"
4444
:step-id="step.id"
4545
:status="step.status"
46-
@input="changeStepSelected"
46+
@change="changeStepSelected"
4747
/>
4848
<AttributionDetailsStep
4949
v-else-if="step.status!=='inactive' && step.name==='AD'"
@@ -258,26 +258,18 @@ export default {
258258
this.$set(this.steps, previousStep, { ...this.steps[previousStep], status: 'current' })
259259
this.currentStepId = previousStep
260260
},
261-
handleFinish() {
262-
// TODO: write the method
263-
},
264261
setActiveStep(clickedStepId) {
265262
/**
266263
* Handles a click on Step header
267264
*/
268265
if (!this.steps[clickedStepId].enabled) return
269266
if (this.steps[clickedStepId].status === 'inactive') return
270-
if (clickedStepId > this.currentStepId) {
271-
for (let i = this.currentStepId; i < clickedStepId; i++) {
272-
this.$set(this.steps, i, { ...this.steps[i], status: 'previous' })
273-
}
274-
this.$set(this.steps, clickedStepId, { ...this.steps[clickedStepId], status: 'current' })
275-
} else {
276-
for (let i = this.currentStepId; i > clickedStepId; i--) {
277-
this.$set(this.steps, i, { ...this.steps[i], status: 'inactive' })
278-
}
279-
this.$set(this.steps, clickedStepId, { ...this.steps[clickedStepId], status: 'current' })
267+
// only steps before the current one are clickable
268+
if (clickedStepId >= this.currentStepId) return
269+
for (let i = this.currentStepId; i > clickedStepId; i--) {
270+
this.$set(this.steps, i, { ...this.steps[i], status: 'inactive' })
280271
}
272+
this.$set(this.steps, clickedStepId, { ...this.steps[clickedStepId], status: 'current' })
281273
this.currentStepId = clickedStepId
282274
},
283275
setStepsVisible(stepsToSetVisible) {

src/utils/license-utilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function generateHTML(attributionDetails, shortLicenseName) {
144144
}
145145
}
146146
if (attributionDetails.workTitle) {
147-
const workTitleSpan = `<span rel="dc:title">${attributionDetails.workTitle}</span>`
147+
const workTitleSpan = `<span rel="dct:title">${attributionDetails.workTitle}</span>`
148148
if (attributionDetails.workUrl) {
149149
dataForHtmlGeneration.workTitle = `<a rel="cc:attributionURL" href="${attributionDetails.workUrl}">${workTitleSpan}</a>`
150150
} else {

tests/e2e/page-objects/chooser.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/**
2+
* Page object for license chooser
3+
*/
4+
5+
const stepperCommands = {
6+
clickYes: function() {
7+
this.click('.step-actions .field:first-of-type .check')
8+
return this
9+
},
10+
clickNo: function() {
11+
this.click('.step-actions .field:last-of-type .check')
12+
return this
13+
},
14+
clickNext: function() {
15+
this.click('.pagination-next')
16+
return this
17+
},
18+
clickPrevious: function() {
19+
this.click('.pagination-previous')
20+
return this
21+
},
22+
chooseNo: function() {
23+
this.clickNo()
24+
.clickNext()
25+
return this
26+
},
27+
chooseYes: function() {
28+
this.clickYes()
29+
.clickNext()
30+
return this
31+
},
32+
clickWaiver: function() {
33+
this.click('.checkbox:first-of-type input[type=checkbox]')
34+
.click('.checkbox:last-of-type input[type=checkbox]')
35+
.click('.pagination-next')
36+
return this
37+
},
38+
selectFromDropdown: function(licenseName) {
39+
this
40+
.waitForElementVisible('.license-dropdown')
41+
.click('.license-dropdown')
42+
.click(`.license-dropdown option[value="${licenseName}"]`)
43+
.click('.pagination-next')
44+
return this
45+
},
46+
assertStepName: function(stepName) {
47+
this.expect.element('@currentStep').to.have.property('classList').contain(stepName)
48+
return this
49+
}
50+
}
51+
const chooserCommands = {
52+
assertSelectedLicenseDisplayed: function(licenseName) {
53+
this
54+
.assert.containsText('.license-name', licenseName)
55+
.assert.containsText('p.license-text a', licenseName)
56+
return this
57+
}
58+
}
59+
module.exports = {
60+
url: '/',
61+
commands: [chooserCommands],
62+
63+
elements: {
64+
appContainer: '#app',
65+
stepper: '.stepper-container',
66+
selectedLicenseCard: '.selected-license-card',
67+
licenseUseCard: '.license-use-card'
68+
},
69+
70+
sections: {
71+
stepper: {
72+
selector: '.stepper-container',
73+
elements: {
74+
currentStep: {
75+
selector: '.step-container.current'
76+
}
77+
},
78+
commands: [stepperCommands]
79+
},
80+
selectedLicenseCard: {
81+
selector: '.selected-license-card'
82+
},
83+
licenseUseCard: {
84+
selector: '.license-use-card'
85+
}
86+
}
87+
88+
}

tests/e2e/page-objects/homepage.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

tests/e2e/specs/AttributionDetailsStep.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module.exports = {
22
'@tags': ['att'],
3-
'AttributionDetailsStep'(browser){
3+
'AttributionDetailsStep'(browser) {
44
const knowLicenseSelector = '.b-radio'
55
const nextButton = '.pagination-next'
66
const select = '#site-container > div.columns > div.stepper-container.column > div.step-container.current.enabled > div.step-content > div > div > div > span > select'
77
const selectOpt = '#site-container > div.columns > div.stepper-container.column > div.step-container.current.enabled > div.step-content > div > div > div > span > select > option:nth-child(4)'
88
const stepTitle = '.step-title'
99
const attributionDetailsInstructions = '.attribution-details-instructions'
10-
const workAuthorLabel ='#site-container > div.columns > div.stepper-container.column > div.step-container.current.enabled > div.step-content > div > form > div:nth-child(1) > label'
10+
const workAuthorLabel = '#site-container > div.columns > div.stepper-container.column > div.step-container.current.enabled > div.step-content > div > form > div:nth-child(1) > label'
1111
const workAuthorInput = '#site-container > div.columns > div.stepper-container.column > div.step-container.current.enabled > div.step-content > div > form > div:nth-child(1) > div > input'
1212
const urlCreatorProfileLabel = '#site-container > div.columns > div.stepper-container.column > div.step-container.current.enabled > div.step-content > div > form > div:nth-child(2) > label'
1313
const urlCreatorProfileInput = '#site-container > div.columns > div.stepper-container.column > div.step-container.current.enabled > div.step-content > div > form > div:nth-child(2) > div > input'
@@ -18,12 +18,11 @@ module.exports = {
1818
const backBtn = '.pagination-previous'
1919
const paginationFinish = '.pagination-finish'
2020

21-
2221
browser
2322
.init()
2423
.click(knowLicenseSelector)
2524
.click(nextButton)
26-
.click(select, () =>{
25+
.click(select, () => {
2726
browser.click(selectOpt)
2827
})
2928
.click(nextButton)
@@ -40,4 +39,4 @@ module.exports = {
4039
.assert.visible(backBtn, 'Back button is visible')
4140
.assert.visible(paginationFinish, 'Pagination Finish Block is visible')
4241
}
43-
}
42+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
'@tags': ['cws'],
3+
'Check if CopyrightWaiver is rendered correctly'(browser) {
4+
browser
5+
.init()
6+
.assert.elementPresent('.control-label > span')
7+
.click('.control-label > span')
8+
.assert.not.cssClassPresent('.pagination-next', 'disabled')
9+
.click('.pagination-next')
10+
.assert.elementPresent('.select > select')
11+
.click('.select > select')
12+
.click('option[value="CC0 1.0"]')
13+
.assert.not.cssClassPresent('.pagination-next', 'disabled')
14+
.click('.pagination-next')
15+
.assert.elementPresent('.control-label')
16+
.assert.elementPresent('.waiver-textarea')
17+
.assert.elementPresent('label:nth-child(1)')
18+
.assert.elementPresent('label:nth-child(3)')
19+
},
20+
21+
'Check if user can check and uncheck checkboxes'(browser) {
22+
browser
23+
.click('label:nth-child(1)>span.control-label')
24+
.click('label:nth-child(3)>span.control-label')
25+
.assert.not.cssClassPresent('.pagination-next', 'disabled', 'Next Button visible when user checks agreed and confirmed')
26+
.click('label:nth-child(1)>span.control-label')
27+
.assert.cssClassPresent('.pagination-next', 'disabled', 'Next button disabled when user unchecks agreed')
28+
.click('label:nth-child(1)>span.control-label')
29+
.assert.not.cssClassPresent('.pagination-next', 'disabled', 'Next Button visible when user re-checks agreed')
30+
.click('label:nth-child(3)>span.control-label')
31+
.assert.cssClassPresent('.pagination-next', 'disabled', 'Next button disabled when user unchecks confirmed')
32+
}
33+
}

tests/e2e/specs/HelpSection.js

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)