Skip to content

Commit

Permalink
e2e: quicker login, fix filter by favorite
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Oct 6, 2023
1 parent 965e0d5 commit 343d5f5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion apps/datahub-e2e/src/e2e/datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('datasets', () => {
beforeEach(() => {
cy.clearCookies()
cy.visit('/search')
cy.viewport(1700, 1200)

// aliases
cy.get('gn-ui-results-list-item').find('a').as('results')
Expand Down
7 changes: 5 additions & 2 deletions apps/datahub-e2e/src/e2e/home.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ describe('header', () => {
.find('[data-cy=recordTitle]')
.invoke('text')
.as('favoriteTitle')
cy.get('@favoriteItem').find('gn-ui-favorite-star').click()
cy.get('@favoriteItem').find('gn-ui-favorite-star button').click()
cy.wait(100)

// show my favorites only
cy.get('datahub-header-badge-button[label$=favorites]').realClick()
cy.get('datahub-header-badge-button[label$=favorites] button').click({
force: true,
})
})
it('only shows one record, same as the favorite one', () => {
cy.get('gn-ui-results-list-item').should('have.length', 1)
Expand Down
6 changes: 0 additions & 6 deletions apps/datahub-e2e/src/e2e/organizations.cy.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import 'cypress-real-events'

const getSortOptions = () => {
cy.get('gn-ui-organisations-sort').find('gn-ui-dropdown-selector').click()
return cy.get('.cdk-overlay-container').find('[role=listbox]')
}

describe('organizations', () => {
beforeEach(() => {
cy.visit('/home/organisations')
cy.viewport(1700, 1200)

// aliases
cy.get('gn-ui-organisations-sort')
Expand Down
2 changes: 1 addition & 1 deletion apps/datahub-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Cypress.Commands.add('login', () => {
if (err.message.includes('postMessage')) return false
})

cy.visit('/geonetwork/srv/eng/catalog.signin?debug')
cy.visit('/geonetwork/srv/eng/catalog.signin?debug&redirect=blargz') // this will point to a 404
cy.get('#inputUsername').type('admin', { force: true })
cy.get('#inputPassword').type('admin', { force: true })
cy.get('[name="gnSigninForm"]').submit()
Expand Down
4 changes: 4 additions & 0 deletions apps/datahub-e2e/src/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@

// Import commands.js using ES2015 syntax:
import './commands'

beforeEach(() => {
cy.viewport(1900, 1400)
})

0 comments on commit 343d5f5

Please sign in to comment.