Skip to content
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

Add missing cypress test commit for BS5 theme #1645

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 8 additions & 8 deletions cypress/e2e/login.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Login', () => {
cy.get('#csrf_token').should('exist')
cy.get('input#email').type(Cypress.env('adminEmail'))
cy.get('input#password').type(Cypress.env('adminPassword'))
cy.get('#user-menu form').submit()
cy.get('#user-menu + .dropdown-menu form').submit()

cy.get('#user-menu').click()
cy.contains('Log out')
Expand All @@ -14,9 +14,9 @@ describe('Login', () => {
it('Logs in through the login page', () => {
cy.visit('/user/login')
cy.get('#csrf_token').should('exist')
cy.get('#content input#email').type(Cypress.env('adminEmail'))
cy.get('#content input#password').type(Cypress.env('adminPassword'))
cy.get('#content form').submit()
cy.get('#main-column input#email').type(Cypress.env('adminEmail'))
cy.get('#main-column input#password').type(Cypress.env('adminPassword'))
cy.get('#main-column form').submit()

cy.get('#user-menu').click()
cy.contains('Log out')
Expand All @@ -28,14 +28,14 @@ describe('Login', () => {
cy.get('#csrf_token').should('exist')
cy.get('input#email').type('[email protected]')
cy.get('input#password').type(Cypress.env('adminPassword'))
cy.get('#user-menu form').submit()
cy.get('#user-menu + .dropdown-menu form').submit()

cy.contains('Sorry, unrecognized email or password')

cy.visit('/user/login')
cy.get('#content input#email').type(Cypress.env('adminEmail'))
cy.get('#content input#password').type('unknown_password')
cy.get('#content form').submit()
cy.get('#main-column input#email').type(Cypress.env('adminEmail'))
cy.get('#main-column input#password').type('unknown_password')
cy.get('#main-column form').submit()

cy.contains('Sorry, unrecognized email or password')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/search.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Search', () => {
cy.request('/informationobject/browse').its('body')
.then(body => {
let deletions = []
Cypress.$(body).find('article.search-result .title a')
Cypress.$(body).find('article.search-result a')
.each((_, link) =>
deletions.push(cy.deleteDescription(
Cypress.$(link).attr('href').split('/').pop()
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Cypress.Commands.add('getCsrfToken', (url, form) =>
)

Cypress.Commands.add('login', () =>
cy.getCsrfToken('/user/login', '#content form').then(token =>
cy.getCsrfToken('/user/login', '#main-column form').then(token =>
cy.request({
method: 'POST',
url: '/user/login',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<?php echo $findingAidForm->renderGlobalErrors(); ?>

<?php echo $findingAidForm->renderFormTag(url_for(['module' => 'settings', 'action' => 'findingAid'])); ?>
<?php echo $findingAidForm->renderFormTag(url_for(['module' => 'settings', 'action' => 'findingAid']), ['data-cy' => 'settings-finding-aid-form']); ?>

<?php echo $findingAidForm->renderHiddenFields(); ?>

Expand Down
Loading