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

Fixing an azuread test where the wrong auth provider is being selected #11201

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

codyrancher
Copy link
Contributor

@codyrancher codyrancher commented Jun 9, 2024

Turns out that the order of the providers has changed (changes all the time?) so this broke the reliance on looking up elements based on index.

Technical notes summary

This change makes the relevant tests more robust by relying on names instead of indices.

Areas which could experience regressions

Only our tests

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@nwmac
Copy link
Member

nwmac commented Jun 10, 2024

Not aware that any providers have been removed.

We should maybe try and select by a data test id that we add, or by something more stable than the index

@codyrancher codyrancher force-pushed the azure-ad-test branch 3 times, most recently from ac4ca00 to 56bace6 Compare June 10, 2024 19:20
@@ -27,6 +27,6 @@ export default class AuthProviderPo extends PagePo {
}

selectAzureAd() {
return this.self().find('[data-testid="select-icon-grid-3"]').click();
return this.self().find('[data-testid="select-icon-grid-AzureAD"]').click();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to name so the test is more resilient and not dependent on list order.

Comment on lines -40 to -43
gridElementExistance(groupIndex = 0, itemIndex = 0, assertion: string) {
this.self().find(`[data-testid="cluster-manager-create-grid-${ groupIndex }-${ itemIndex }"]`).should(assertion);
}

Copy link
Contributor Author

@codyrancher codyrancher Jun 10, 2024

Choose a reason for hiding this comment

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

This was only used in one location and I removed it because this was a little clunky and there was already an existing lookup by name that could be used instead.

It appears that there are 2 less providers being used now. Is this a backend issue?
Copy link
Member

@momesgin momesgin left a comment

Choose a reason for hiding this comment

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

lgtm

@momesgin momesgin marked this pull request as ready for review June 10, 2024 21:02
@codyrancher codyrancher merged commit bc74f41 into rancher:master Jun 10, 2024
34 checks passed
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.

3 participants