-
Notifications
You must be signed in to change notification settings - Fork 23
PROCESS : 'compare_licences' may be tested with cypress-cucumber (see… #323
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,8 @@ Soit("{string} le document principal", (title) => { | |
| 'Treignes, le 8 septembre 2012 (Christophe Lejeune)': '/6b56ee657c870dfacd34e9ae4e0643dd', | ||
| 'Restaurer la vapeur': '/6b56ee657c870dfacd34e9ae4e050fcc', | ||
| 'Vestiges (diagramme de classes)': '/146e6e8442f0405b721b79357d0021e3', | ||
| 'Víly (Charles Perrault)' : '/420ab198674f11eda3b7a3fdd5ea984f', | ||
| 'Entretien avec un responsable d\'opération' : '/05b61f5285c711ed97bf6b9b56808c45', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previous lines (39) is related to your scenario but not this one. |
||
| }; | ||
| expect(uris).to.contain.key(title); | ||
| cy.visit(uris[title]); | ||
|
|
@@ -150,3 +152,17 @@ Soit("ayant les métadonnées", (metadata) => { | |
| }); | ||
| cy.get('.scholium>.icon.focus').click(); | ||
| }); | ||
|
|
||
| Soit("{string} le nom de la licence du document principal", (n_licence) => { | ||
| cy.get('.license-container').eq(0).find('.license').then($license => { | ||
| if ($license.find('img').length) { | ||
| cy.wrap($license).find('img').should('have.attr', 'alt', n_licence); | ||
| } else if ($license.find('span').length) { | ||
| cy.wrap($license).find('span').should('have.text', n_licence); | ||
| } else if ($license.text().includes(n_licence)) { | ||
| expect($license.text()).to.include(n_licence); | ||
| } else { | ||
| throw new Error('Neither img nor span found in .license, or license text does not contain expected value'); | ||
| } | ||
| }); | ||
| }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing Capybara code was perhaps too simple but why is this code so complicated? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,3 +117,18 @@ Quand("je consulte les informations de création du document", function () { | |
| cy.get('.info-icon-container').trigger('mouseover'); | ||
| }); | ||
|
|
||
| Quand("je consulte le contenu de {string}", function (title) { | ||
| const uris = { | ||
| 'Les fées (Charles Perrault)': '/37b4b9ba5cdb11ed887beb5c373fa643', | ||
| 'Vidéo Sherlock Jr. (Buster Keaton)': '/4e1a31e14b032f2fa9e161ee9b009125', | ||
| 'Treignes, le 8 septembre 2012 (Christophe Lejeune)': '/6b56ee657c870dfacd34e9ae4e0643dd', | ||
| 'Restaurer la vapeur': '/6b56ee657c870dfacd34e9ae4e050fcc', | ||
| 'Vestiges (diagramme de classes)': '/146e6e8442f0405b721b79357d0021e3', | ||
| 'Víly (Charles Perrault)' : '/420ab198674f11eda3b7a3fdd5ea984f', | ||
| 'Fairies (Charles Perrault)' : '/96bddee6-24b2-11ef-a1f4-5351a35fcaac', | ||
| 'Étiquetage de l\'entretien' : '/6327c5008d1f11ed9aa8e7ae771dee2e', | ||
| }; | ||
| expect(uris).to.contain.key(title); | ||
| cy.get(`a.icon.open[href*="#${uris[title].slice(1)}"]`).click(); | ||
| } | ||
| ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there is a misunderstanding about what this step is intended to do. If you look at the existing in Capybara (see |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not coherent with line 18 of the same file.
Either change both or keep both.