make tests less flaky

This commit is contained in:
Elio Bischof 2022-07-22 12:48:02 +02:00
parent 69ac3444d2
commit 7b1e22357d
No known key found for this signature in database
GPG Key ID: 7B383FDE4DDBF1BD
7 changed files with 10 additions and 8 deletions

View File

@ -23,7 +23,7 @@ describe('humans', () => {
});
it('should add a user', () => {
cy.get('[data-e2e="create-user-button"]').click();
cy.get('[data-e2e="action-key-add"]').parents('[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

View File

@ -23,7 +23,7 @@ describe('machines', () => {
});
it('should add a machine', () => {
cy.get('[data-e2e="create-user-button"]').click();
cy.get('[data-e2e="action-key-add"]').parents('[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 });

View File

@ -25,11 +25,11 @@ describe('permissions', () => {
ensureProjectExists(apiCalls, testProjectName).then(projId => {
projectId = projId
cy.visit(`${Cypress.env('baseUrl')}/ui/console/projects/${projId}?id=roles`)
cy.get('[data-e2e=timestamp]');
})
})
})
describe('add role', () => {
beforeEach(()=> {
ensureProjectResourceDoesntExist(api, projectId, Roles, testRoleName)

View File

@ -44,8 +44,9 @@ describe('projects', () => {
cy.get('[data-e2e=toggle-grid]').click();
cy.get('[data-e2e=timestamp]');
cy.contains('tr', testProjectNameDeleteList, { timeout: 1000 })
.find('[data-e2e=table-actions-button]')
.find('[data-e2e=delete-project-button]')
.click({force: true});
cy.get('[e2e-data="confirm-dialog-input"]').type(testProjectNameDeleteList);
cy.get('[e2e-data="confirm-dialog-button"]').click();
cy.get('.data-e2e-success');
cy.wait(200);

View File

@ -6,7 +6,7 @@
<span>ESC</span>
</div>
</div>
<div *ngSwitchCase="ActionKeysType.ADD" class="action-keys-row">
<div *ngSwitchCase="ActionKeysType.ADD" class="action-keys-row" [attr.data-e2e]="'action-key-add'">
<div class="action-key">
<div class="key-overlay"></div>
<span>N</span>

View File

@ -5,8 +5,8 @@
<ng-template cnslHasRole [hasRole]="['project.role.write:' + projectId, 'project.role.write']" actions>
<a *ngIf="actionsVisible" [disabled]="disabled" [routerLink]="[ '/projects', projectId, 'roles', 'create']"
color="primary" class="cnsl-action-button" mat-raised-button [attr.data-e2e]="'add-new-role'">
<mat-icon class="icon">add</mat-icon>
color="primary" class="cnsl-action-button" mat-raised-button>
<mat-icon [attr.data-e2e]="'add-new-role'" class="icon">add</mat-icon>
<span>{{ 'ACTIONS.NEW' | translate }}</span>
<cnsl-action-keys (actionTriggered)="gotoRouterLink([ '/projects', projectId, 'roles', 'create'])">
</cnsl-action-keys>

View File

@ -84,7 +84,8 @@
<td mat-cell *matCellDef="let project">
<cnsl-table-actions>
<button actions *ngIf="project.id !== zitadelProjectId" color="warn" mat-icon-button
matTooltip="{{'ACTIONS.DELETE' | translate}}" (click)="deleteProject(project.id, project.name)">
matTooltip="{{'ACTIONS.DELETE' | translate}}" (click)="deleteProject(project.id, project.name)"
[attr.data-e2e]="'delete-project-button'">
<i class="las la-trash"></i>
</button>
</cnsl-table-actions>