From 6a47d37a6c2893c39b1bb13c039629b32d13c766 Mon Sep 17 00:00:00 2001 From: Elio Bischof Date: Thu, 21 Jul 2022 11:52:13 +0200 Subject: [PATCH] fix some tests --- console/cypress/e2e/humans/humans.cy.ts | 4 ++-- console/cypress/e2e/machines/machines.cy.ts | 4 ++-- console/cypress/e2e/permissions/permissions.cy.ts | 2 +- console/cypress/e2e/projects/projects.cy.ts | 7 ++++--- console/src/app/modules/paginator/paginator.component.html | 2 +- .../app/modules/table-actions/table-actions.component.html | 3 ++- .../users/user-list/user-table/user-table.component.html | 5 +++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/console/cypress/e2e/humans/humans.cy.ts b/console/cypress/e2e/humans/humans.cy.ts index aedd0fcc96..6f81997dd9 100644 --- a/console/cypress/e2e/humans/humans.cy.ts +++ b/console/cypress/e2e/humans/humans.cy.ts @@ -12,7 +12,7 @@ describe('humans', () => { beforeEach(() => { login(user); cy.visit(humansPath); - cy.get('[data-cy=timestamp]'); + cy.get('[data-e2e=timestamp]'); }); describe('add', () => { @@ -23,7 +23,7 @@ describe('humans', () => { }); it('should add a user', () => { - cy.get('a[href="/users/create"]').click(); + cy.get('[data-e2e="create-user-button"]').click(); cy.url().should('contain', 'users/create'); cy.get('[formcontrolname="email"]').type(username('e2ehuman')); //force needed due to the prefilled username prefix diff --git a/console/cypress/e2e/machines/machines.cy.ts b/console/cypress/e2e/machines/machines.cy.ts index 7fac07522c..898307a216 100644 --- a/console/cypress/e2e/machines/machines.cy.ts +++ b/console/cypress/e2e/machines/machines.cy.ts @@ -12,7 +12,7 @@ describe('machines', () => { beforeEach(() => { login(user); cy.visit(machinesPath); - cy.get('[data-cy=timestamp]'); + cy.get('[data-e2e=timestamp]'); }); describe('add', () => { @@ -23,7 +23,7 @@ describe('machines', () => { }); it('should add a machine', () => { - cy.get('a[href="/users/create-machine"]').click(); + cy.get('[data-e2e="create-user-button"]').click(); cy.url().should('contain', 'users/create-machine'); //force needed due to the prefilled username prefix cy.get('[formcontrolname="userName"]').type(testMachineUserNameAdd, { force: true }); diff --git a/console/cypress/e2e/permissions/permissions.cy.ts b/console/cypress/e2e/permissions/permissions.cy.ts index 59e85c7107..d5bc4f4824 100644 --- a/console/cypress/e2e/permissions/permissions.cy.ts +++ b/console/cypress/e2e/permissions/permissions.cy.ts @@ -24,7 +24,7 @@ describe('permissions', () => { api = apiCalls ensureProjectExists(apiCalls, testProjectName).then(projId => { projectId = projId - cy.visit(`${Cypress.env('baseUrl')}/ui/console/projects/${projId}`) + cy.visit(`${Cypress.env('baseUrl')}/ui/console/projects/${projId}?id=roles`) }) }) }) diff --git a/console/cypress/e2e/projects/projects.cy.ts b/console/cypress/e2e/projects/projects.cy.ts index 3d684cc88e..b3cfd6596d 100644 --- a/console/cypress/e2e/projects/projects.cy.ts +++ b/console/cypress/e2e/projects/projects.cy.ts @@ -42,10 +42,10 @@ describe('projects', () => { it('removes the project', () => { cy.get('[data-e2e=toggle-grid]').click(); - cy.get('[data-cy=timestamp]'); + cy.get('[data-e2e=timestamp]'); cy.contains('tr', testProjectNameDeleteList, { timeout: 1000 }) - .find('[data-e2e=delete-project-button]') - .click({ force: true }); + .find('[data-e2e=table-actions-button]') + .click({force: true}); cy.get('[e2e-data="confirm-dialog-button"]').click(); cy.get('.data-e2e-success'); cy.wait(200); @@ -66,6 +66,7 @@ describe('projects', () => { .find('[data-e2e=delete-project-button]') .trigger('mouseover') .click(); + cy.get('[e2e-data="confirm-dialog-input"]').type(testProjectNameDeleteGrid); cy.get('[e2e-data="confirm-dialog-button"]').click(); cy.get('.data-e2e-success'); cy.wait(200); diff --git a/console/src/app/modules/paginator/paginator.component.html b/console/src/app/modules/paginator/paginator.component.html index 08fa472c4c..3206d854d3 100644 --- a/console/src/app/modules/paginator/paginator.component.html +++ b/console/src/app/modules/paginator/paginator.component.html @@ -3,7 +3,7 @@

{{ length }} {{ 'PAGINATOR.COUNT' | translate }}

-

+

{{ timestamp | timestampToDate | localizedDate: 'EEEE dd. MMM YYYY, HH:mm' }}

diff --git a/console/src/app/modules/table-actions/table-actions.component.html b/console/src/app/modules/table-actions/table-actions.component.html index 8a06c86206..fe4eabe7c1 100644 --- a/console/src/app/modules/table-actions/table-actions.component.html +++ b/console/src/app/modules/table-actions/table-actions.component.html @@ -3,7 +3,8 @@ diff --git a/console/src/app/pages/users/user-list/user-table/user-table.component.html b/console/src/app/pages/users/user-list/user-table/user-table.component.html index bb83827477..75b088073c 100644 --- a/console/src/app/pages/users/user-list/user-table/user-table.component.html +++ b/console/src/app/pages/users/user-list/user-table/user-table.component.html @@ -9,10 +9,10 @@ [showBorder]="true" >
- -
@@ -52,6 +52,7 @@ mat-raised-button [disabled]="!canWrite" class="cnsl-action-button" + [attr.data-e2e]="'create-user-button'" > add {{ 'ACTIONS.NEW' | translate }}