Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress: find a way to preserve auth info and server in 'after' part of tests #1220

Closed
AoNoOokami opened this issue Sep 15, 2020 · 0 comments · Fixed by #1260
Closed

Cypress: find a way to preserve auth info and server in 'after' part of tests #1220

AoNoOokami opened this issue Sep 15, 2020 · 0 comments · Fixed by #1260
Labels
dev: tests For all types of tests: unit tests, e2e (Cypress)... developers From a developer point of view.

Comments

@AoNoOokami
Copy link
Contributor

How it works

By now, some code is repeated in the after part of test:

  • It's needed to login again to avoid 401 errors with the test
  • If there are ' wait an alias' instructions, we have to start a server again

Improvement suggestion
There might be a better way to do this and not repeat the code. Making the hypothesis that both behaviours reported are linked, we may find an answer by managing the cookies during the test. See the documentation here: https://docs.cypress.io/api/cypress-api/cookies.html#Preserve-Once

@AoNoOokami AoNoOokami added enhancement Improvement of an existing feature dev: tests For all types of tests: unit tests, e2e (Cypress)... labels Sep 15, 2020
@iGormilhit iGormilhit added developers From a developer point of view. and removed enhancement Improvement of an existing feature labels Sep 16, 2020
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Oct 27, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Renames 'templates' in 'examples' in order to avoid confusion with rero-ils
  template resource.
* Adds cookies preservation to keep authentication information between tests.
* Improves login and logout methods.
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Oct 28, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Renames 'templates' in 'examples' in order to avoid confusion with rero-ils
  template resource.
* Adds cookies preservation to keep authentication information between tests.
* Improves login and logout methods.
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Oct 28, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Renames 'templates' in 'examples' in order to avoid confusion with rero-ils
  template resource.
* Adds cookies preservation to keep authentication information between tests.
* Improves login and logout methods.
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Oct 30, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Renames 'templates' in 'examples' in order to avoid confusion with rero-ils
  template resource.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Adds a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Oct 30, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Renames 'templates' in 'examples' in order to avoid confusion with rero-ils
  template resource.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Adds a test for login and logout (UI actions).
* Improves templates test in order to allow retries if the test fails or
don't go to the end.
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Oct 30, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Renames 'templates' in 'examples' in order to avoid confusion with rero-ils
  template resource.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Adds a test for login and logout (UI actions).
* Improves templates test in order to allow retries if the test fails or
don't go to the end.
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Oct 30, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Adds a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Nov 2, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Adds a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Nov 2, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Creates a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Nov 2, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Creates a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit to AoNoOokami/rero-ils that referenced this issue Nov 3, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Creates a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes rero#1220.

Co-Authored-by: Alicia Zangger <[email protected]>
AoNoOokami pushed a commit that referenced this issue Nov 3, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Creates a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes #1220.

Co-Authored-by: Alicia Zangger <[email protected]>
BadrAly pushed a commit that referenced this issue Nov 5, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Creates a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes #1220.

Co-Authored-by: Alicia Zangger <[email protected]>
zannkukai pushed a commit that referenced this issue Nov 5, 2020
* Creates e2e tests for collections.
* Replaces 'goToMenu' custom command in order not to go to the frontpage
  each time we navigate in the app.
* Adds an empty template to re-use for test creation.
* Adds cookies preservation to keep authentication information between tests.
* Changes login and logout commands in order to use API calls instead of
UI actions.
* Creates a test for login and logout (UI actions).
* Allows language preservation in professional interface.
* Closes #1220.

Co-Authored-by: Alicia Zangger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev: tests For all types of tests: unit tests, e2e (Cypress)... developers From a developer point of view.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants