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 for create user flow #45

Merged
merged 4 commits into from
Sep 17, 2024
Merged

tests for create user flow #45

merged 4 commits into from
Sep 17, 2024

Conversation

christopherjturner
Copy link
Contributor

@christopherjturner christopherjturner commented Sep 10, 2024

aad-user

Copy link
Contributor

@feedmypixel feedmypixel left a comment

Choose a reason for hiding this comment

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

A couple of things:

  1. For interacting with forms there is the form component https://github.com/DEFRA/cdp-portal-tests/blob/main/test/components/form.component.js

This selects form controls by their label text, or button text, so you don't have to make custom nextButton or searchByAADName methods. This is also implicitly testing that the forms and form controls are built correctly.

fEx:

      await FormComponent.inputLabel('Name').click()
      await browser.keys(testRepositoryName)

      await FormComponent.inputLabel('Template').click()
      await browser.keys(serviceType)

      await FormComponent.inputLabel('Owning Team').click()
      await browser.keys('Platform')

      await FormComponent.submitButton('Next').click()
  1. Have you read this? finding-elements-in-tests. It explains why using css selectors or ids is brittle and prone to breaking. And how to write test hooks so that when a dev is working in the Portal Frontend they can easily see that the element is being references in tests.

- User prior art available
- Add various hooks into the PFE
- Add component helpers
- Rename work to user
@feedmypixel feedmypixel merged commit 9c4db1f into main Sep 17, 2024
2 checks passed
@feedmypixel feedmypixel deleted the 433616-create-user branch September 17, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants