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

[Test] Add test that revokes OAuth access from Dashboard #22762

Merged
merged 5 commits into from
Jan 15, 2024

Conversation

SkorikSergey
Copy link
Contributor

@SkorikSergey SkorikSergey commented Jan 11, 2024

What does this PR do?

This test automate revoke OAuth access from User Preferences page.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-4841

How to test this PR?

PR Checklist

▼ UserPreferences.openUserPreferencesPage ‣ DriverHelper.waitAndClick - By(xpath, //header//button/span[text()!=""]//parent::button) ‣ DriverHelper.waitVisibility - By(xpath, //header//button/span[text()!=""]//parent::button) ‣ DriverHelper.waitVisibility - element is located and is visible. ‣ DriverHelper.waitAndClick - By(xpath, //button[text()="User Preferences"]) ‣ DriverHelper.waitVisibility - By(xpath, //button[text()="User Preferences"]) ‣ DriverHelper.waitVisibility - element is located and is visible. ‣ DriverHelper.waitVisibility - By(xpath, //h1[text()="User Preferences"]) ‣ DriverHelper.waitVisibility - element is located and is visible. ▼ UserPreferences.openGitServicesTab ‣ DriverHelper.waitAndClick - By(xpath, //button[text()="Git Services"]) ‣ DriverHelper.waitVisibility - By(xpath, //button[text()="Git Services"]) ‣ DriverHelper.waitVisibility - element is located and is visible. ▼ UserPreferences.revokeGitService ▼ UserPreferences.selectListItem - of the 'GitHub' list item ‣ DriverHelper.waitAndClick - By(xpath, //tr[td[text()='GitHub']]//input) ‣ DriverHelper.waitVisibility - By(xpath, //tr[td[text()='GitHub']]//input) ‣ DriverHelper.waitVisibility - element is located and is visible. ‣ DriverHelper.waitAndClick - By(xpath, //button[text()="Revoke"]) ‣ DriverHelper.waitVisibility - By(xpath, //button[text()="Revoke"]) ‣ DriverHelper.waitVisibility - element is located and is visible. ‣ DriverHelper.waitVisibility - By(xpath, //span[text()="Revoke Git Services"]) ‣ DriverHelper.waitVisibility - element is located and is visible. ‣ DriverHelper.waitAndClick - By(xpath, //input[@data-testid="warning-info-checkbox"]) ‣ DriverHelper.waitVisibility - By(xpath, //input[@data-testid="warning-info-checkbox"]) ‣ DriverHelper.waitVisibility - element is located and is visible. ‣ DriverHelper.waitAndClick - By(xpath, //button[@data-testid="revoke-button" and not(@disabled)]) ‣ DriverHelper.waitVisibility - By(xpath, //button[@data-testid="revoke-button" and not(@disabled)]) ‣ DriverHelper.waitVisibility - element is located and is visible. ‣ DriverHelper.waitDisappearance - By(xpath, //tr[td[text()='GitHub']]//input) ‣ DriverHelper.waitDisappearanceBoolean - By(xpath, //tr[td[text()='GitHub']]//input) ‣ DriverHelper.isVisible - By(xpath, //tr[td[text()='GitHub']]//input) ‣ DriverHelper.wait - (1000 milliseconds) ‣ DriverHelper.isVisible - By(xpath, //tr[td[text()='GitHub']]//input) ✔ Revoke OAuth test

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@SkorikSergey SkorikSergey added status/in-progress This issue has been taken by an engineer and is under active development. area/qe labels Jan 11, 2024
@SkorikSergey SkorikSergey self-assigned this Jan 11, 2024
@SkorikSergey SkorikSergey added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. and removed status/in-progress This issue has been taken by an engineer and is under active development. labels Jan 11, 2024
@che-bot che-bot added the target/branch Indicates that a PR will be merged into a branch other than master. label Jan 11, 2024
@SkorikSergey SkorikSergey marked this pull request as ready for review January 11, 2024 14:49
@dmytro-ndp
Copy link
Contributor

@SkorikSergey: do you have successful RevokeOauth.spec.ts test run to review?

@SkorikSergey
Copy link
Contributor Author

@SkorikSergey: do you have successful RevokeOauth.spec.ts test run to review?

Yes, checked with GitHub service.

@@ -14,14 +14,25 @@ import { By } from 'selenium-webdriver';
import { DriverHelper } from '../../utils/DriverHelper';
import { Logger } from '../../utils/Logger';

enum GitServices {
GITHUB = 'github',
Copy link
Contributor

Choose a reason for hiding this comment

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


getServiceConfig(service: string): string {
const gitService: { [key: string]: string } = {
[GitServices.GITHUB]: 'GitHub',
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@dmytro-ndp dmytro-ndp left a comment

Choose a reason for hiding this comment

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

Looks commonly good to merge, with a small room for improvement commented earlier.

@SkorikSergey SkorikSergey merged commit f7a4289 into main Jan 15, 2024
5 checks passed
@SkorikSergey SkorikSergey deleted the addRevokeOauthTest branch January 15, 2024 15:25
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qe target/branch Indicates that a PR will be merged into a branch other than master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants