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

Add Playwright with eslint and example login test #1590

Merged
merged 71 commits into from
Sep 24, 2024

Conversation

Piotrk39
Copy link
Contributor

@Piotrk39 Piotrk39 commented Sep 19, 2024

Describe your changes

Adds Playwright E2E automation tool to IBF-system Github repository, that includes:

  • E2E test Directory
  • E2E example login test
  • Page Object Model (POM)
  • Eslint for E2E test directory

ToDo:

  • Connect with API tests to generate token and reset DB for creating correct state
  • Remove Cypress and it's dependencies
  • Add Readme
  • Add CI/CD configuration to run on every PR

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added tests wherever relevant
  • I have made sure that all automated checks pass before requesting a review

@Piotrk39 Piotrk39 added dependencies Pull requests that update a dependency file ci Pull requests that update the ci workflow test This involves testing labels Sep 19, 2024
@jannisvisser jannisvisser linked an issue Sep 24, 2024 that may be closed by this pull request
@jannisvisser jannisvisser merged commit f9b06b1 into master Sep 24, 2024
7 checks passed
@jannisvisser jannisvisser deleted the feat.add-playwright branch September 24, 2024 10:30
run: |
cp example.env .env

- name: Install API-service code-dependencies
Copy link
Member

Choose a reason for hiding this comment

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

Can this step be removed? The docker image should have the required libraries from this step.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gulfaraz good question. It seemed necessary, because the e2e tests are run from the host with 'npm test', and they in turn use some of the API-service files (e.g. utility.helper.ts) to reset the DB, which in turn needs the 'supertest' package. And without this 'npm install' step on the host instead of within the container, this package was not found.

Do you think this setup should be changed?

Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't be that the installation is needed on the host machine while the service is running inside docker.

I will investigate this before I propose a change.

@gulfaraz
Copy link
Member

@Piotrk39 is there a benefit to keep the e2e tests in a separate workflow? I would like a setup where a failure of an end-2-end test will block the version bump in the other workflow. As these workflows are currently independent, the version gets bumped regardless of the e2e tests.

FYI @jannisvisser

@Piotrk39
Copy link
Contributor Author

@gulfaraz We should add new item to fix that

@Piotrk39 is there a benefit to keep the e2e tests in a separate workflow? I would like a setup where a failure of an end-2-end test will block the version bump in the other workflow. As these workflows are currently independent, the version gets bumped regardless of the e2e tests.

FYI @jannisvisser

@jannisvisser
Copy link
Contributor

@gulfaraz could we alternatively block merging to master if not all tests succeed?

@gulfaraz
Copy link
Member

Yes, if we can figure out a way to link the other workflow to the version bump step.

It also doesn't make sense to me that we repeat certain steps in both workflows. Github actions has a limit so I think it's wise to use this limited resource efficiently. But if the need is there we can absolutely repeat certain steps, this is why I asked if the decision to have a separate workflow is deliberate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Pull requests that update the ci workflow dependencies Pull requests that update a dependency file test This involves testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Setup playwright for e2e tests
3 participants