Skip to content

Commit

Permalink
e2e(ME): fix a couple of e2e tests
Browse files Browse the repository at this point in the history
* wait for results to show up before logging out
  otherwise we might end up with duplicated session cookies => not good
* wait a bit before duplicating a record to be sure to pick the right
  one
  • Loading branch information
jahow committed Jan 23, 2025
1 parent ecd08a3 commit 739c378
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ describe('Logging in and out', () => {
beforeEach(() => {
cy.login('admin', 'admin', false)
cy.visit('/catalog/search')
// wait for results
cy.get('gn-ui-results-table')
.find('[data-cy=table-row]')
.should('have.length.above', 1)
})
it('logs out the user', () => {
cy.get('gn-ui-avatar').should('be.visible')
Expand Down
5 changes: 5 additions & 0 deletions apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ describe('record-actions', () => {
describe('duplicate', () => {
it('should duplicate the record', () => {
cy.get('.table-header-cell').eq(1).click()

// wait for 500ms because the order might change
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500)

cy.get('[data-cy="table-row"]')
.first()
.find('[data-test="record-menu-button"]')
Expand Down

0 comments on commit 739c378

Please sign in to comment.