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

Tests e2e Playwright : Store logs in Project POM #5226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rldhont
Copy link
Collaborator

@rldhont rldhont commented Jan 16, 2025

Follow up #5204

Add a way to store and check logs in Project page.

Follow up 3liz#5204

Add a way to store and check logs in Project page.
@rldhont rldhont added tests unit tests and docker configuration for tests run end2end If the PR must run end2end tests or not backport release_3_7 backport release_3_8 backport release_3_9 labels Jan 16, 2025
@rldhont rldhont requested review from Gustry and nboisteault January 16, 2025 17:29
@github-actions github-actions bot added this to the 3.10.0 milestone Jan 16, 2025
Copy link
Member

@Gustry Gustry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea !
Especially when the test is failing because of that.

Let's wait for #5225 ?

The next steps will be to do a check afterEach, afterAll ... for Javascript logs and server logs.

@@ -103,6 +135,7 @@ export class ProjectPage {
*/
async open(){
await gotoMap(`/index.php/view/map?repository=${this.repository}&project=${this.project}`, this.page);
expect(this.logs).toHaveLength(0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This problem of this open method, it's used only 3 times, versus 107 times for the function gotoMap.

What don't we move it to a "standalone function" instead of a method of this class ? So it can be called at the end of gotoMap, while we are doing the transition.

If we want to keep it in POM, I think #5225 should be merged first, so it can be in the base class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a draft to test it. I don't know how we will have to use it.

* @property {string} message - the log message text
* @property {string} location - the log message location in one line
* @see https://playwright.dev/docs/api/class-consolemessage
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not sure to understand the purpose of this block ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is done to describe logMessage object to simplify logs property description.

https://jsdoc.app/tags-typedef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_3_7 backport release_3_8 backport release_3_9 run end2end If the PR must run end2end tests or not tests unit tests and docker configuration for tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants