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

Hotfix fix cookie policy approval #22555

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/e2e/pageobjects/login/openshift/OcpRedHatLoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export class OcpRedHatLoginPage implements ICheLoginPage {
);
await this.ocpLogin.waitAndClickOnLoginProviderTitle();
await this.redHatLogin.waitRedHatLoginWelcomePage();
try {
await this.redHatLogin.waitAndConfirmCookiePolicy();
} catch (err) {
Logger.warn('Cookie confirmation dialog not present, continuing...');
Logger.warn(`${err}`);
}
await this.redHatLogin.enterUserNameRedHat();
await this.redHatLogin.clickNextButton();
await this.redHatLogin.enterPasswordRedHat();
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/pageobjects/login/openshift/RedHatLoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export class RedHatLoginPage {
private static readonly PASSWORD_INPUT: By = By.id('password');
private static readonly NEXT_BUTTON: By = By.id('login-show-step2');
private static readonly LOGIN_BUTTON: By = By.id('rh-password-verification-submit-button');
private static readonly COOKIE_DIALOG_IFRAME: By = By.xpath('//div[@class="truste_box_overlay"]//iframe[@class="truste_popframe"]');
private static readonly COOKIE_DIALOG_BUTTON: By = By.xpath('//div[@class="pdynamicbutton"]//a[@class="call"]');

constructor(
@inject(CLASSES.DriverHelper)
Expand All @@ -34,6 +36,18 @@ export class RedHatLoginPage {
await this.driverHelper.waitVisibility(RedHatLoginPage.USERNAME_INPUT, TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
}

async waitAndConfirmCookiePolicy(): Promise<void> {
Logger.debug();

await this.driverHelper.waitVisibility(RedHatLoginPage.COOKIE_DIALOG_IFRAME, TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
await this.driverHelper
.getDriver()
.switchTo()
.frame(await this.driverHelper.getDriver().findElement(RedHatLoginPage.COOKIE_DIALOG_IFRAME));
await this.driverHelper.waitAndClick(RedHatLoginPage.COOKIE_DIALOG_BUTTON, TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
await this.driverHelper.refreshPage();
dmytro-ndp marked this conversation as resolved.
Show resolved Hide resolved
}

async enterPasswordRedHat(): Promise<void> {
Logger.debug();

Expand Down
Loading