From c80091ba9c736b064624eaf4b4fea248a7b1e0db Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Fri, 3 Jan 2025 15:04:28 +0300 Subject: [PATCH] Fix unstable headlessCreateUser cypress command (#8885) ### Motivation and context ### How has this been tested? ### Checklist - [x] I submit my changes into the `develop` branch - [ ] I have created a changelog fragment - [ ] I have updated the documentation accordingly - [ ] I have added tests to cover my changes - [ ] I have linked related issues (see [GitHub docs]( https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)) - [ ] I have increased versions of npm packages if it is necessary ([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning), [cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning), [cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning) and [cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning)) ### License - [x] I submit _my code changes_ under the same [MIT License]( https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. ## Summary by CodeRabbit - **New Features** - Enhanced user creation command with improved error handling and validation. - Added assertions to verify successful user registration and email correctness. --------- Co-authored-by: Kirill Lakhov --- .../e2e/actions_projects_models/markdown_base_pipeline.js | 4 ++-- .../case_28_review_pipeline_feature.js | 4 ++-- tests/cypress/support/commands.js | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/cypress/e2e/actions_projects_models/markdown_base_pipeline.js b/tests/cypress/e2e/actions_projects_models/markdown_base_pipeline.js index 51143c318794..639e57ad09f1 100644 --- a/tests/cypress/e2e/actions_projects_models/markdown_base_pipeline.js +++ b/tests/cypress/e2e/actions_projects_models/markdown_base_pipeline.js @@ -14,14 +14,14 @@ context('Basic markdown pipeline', () => { username: 'md_job_assignee', firstName: 'Firstname', lastName: 'Lastname', - emailAddr: 'md_job_assignee@local.local', + email: 'md_job_assignee@local.local', password: 'Fv5Df3#f55g', }, taskAssignee: { username: 'md_task_assignee', firstName: 'Firstname', lastName: 'Lastname', - emailAddr: 'md_task_assignee@local.local', + email: 'md_task_assignee@local.local', password: 'UfdU21!dds', }, notAssignee: { diff --git a/tests/cypress/e2e/actions_users/registration_involved/case_28_review_pipeline_feature.js b/tests/cypress/e2e/actions_users/registration_involved/case_28_review_pipeline_feature.js index c77e00df3ad1..464464492832 100644 --- a/tests/cypress/e2e/actions_users/registration_involved/case_28_review_pipeline_feature.js +++ b/tests/cypress/e2e/actions_users/registration_involved/case_28_review_pipeline_feature.js @@ -12,14 +12,14 @@ context('Review pipeline feature', () => { username: 'annotator', firstName: 'Firstname', lastName: 'Lastname', - emailAddr: 'annotator@local.local', + email: 'annotator@local.local', password: 'UfdU21!dds', }, reviewer: { username: 'reviewer', firstName: 'Firstname', lastName: 'Lastname', - emailAddr: 'reviewer@local.local', + email: 'reviewer@local.local', password: 'Fv5Df3#f55g', }, }; diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 42b7d2772375..a027c260e7b0 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -360,8 +360,12 @@ Cypress.Commands.add('headlessCreateUser', (userSpec) => { headers: { 'Content-type': 'application/json', }, + }).then((response) => { + expect(response.status).to.eq(201); + expect(response.body.username).to.eq(userSpec.username); + expect(response.body.email).to.eq(userSpec.email); + return cy.wrap(); }); - return cy.wrap(); }); Cypress.Commands.add('headlessLogout', () => {