Skip to content

Commit

Permalink
Fixed ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Jul 4, 2024
1 parent abb5b68 commit 43dbc11
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/pages/FO/FOBasePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ export default class FOBasePage extends CommonPage implements FOBasePagePageInte
this.languageSelectorExpandIcon = `${this.languageSelectorDiv} i.expand-more`;
this.languageSelectorList = `${this.languageSelectorDiv} .js-dropdown.open`;
this.languageSelectorMenuItemLink = `${this.languageSelectorDiv} ul li a`;
this.languageSelectorMenuItemLinkLang = (language) => this.languageSelectorMenuItemLink
+ `[data-iso-code='${language}']`;
this.languageSelectorMenuItemLinkLang = (language) => `${this.languageSelectorMenuItemLink
}[data-iso-code='${language}']`;
this.currencySelectorDiv = '#_desktop_currency_selector';
this.defaultCurrencySpan = `${this.currencySelectorDiv} button span`;
this.currencySelectorExpandIcon = `${this.currencySelectorDiv} i.expand-more`;
Expand Down Expand Up @@ -793,13 +793,14 @@ export default class FOBasePage extends CommonPage implements FOBasePagePageInte

private getLanguageSelector(page: Page, lang: string): string|Locator {
const psVersion = testContext.getPSVersion();

// >= 1.7.5.0
if (semver.gte(psVersion, '7.5.0')) {
return this.languageSelectorMenuItemLinkLang(lang);
}

return page.locator(this.languageSelectorMenuItemLink).filter({
hasText: lang == 'en' ? 'English' : 'Français',
hasText: lang === 'en' ? 'English' : 'Français',
});
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/commonPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,13 @@ export default class CommonPage implements CommonPageInterface {
timeout: number = 30000,
): Promise<void> {
let locator: Locator;

if (typeof selector === 'string') {
locator = page.locator(selector);
} else {
locator = selector;
}

await Promise.all([
page.waitForLoadState(state, {timeout}),
locator.click(),
Expand All @@ -445,6 +446,7 @@ export default class CommonPage implements CommonPageInterface {
timeout: number = 30000,
): Promise<void> {
let locator: Locator;

if (typeof selector === 'string') {
locator = page.locator(selector);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/versions/1.7.2/pages/BO/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LoginPageVersion extends LoginPage implements LoginPageInterface {
this.submitLoginButton = 'form#login_form button[name="submitLogin"]';

//
this.errorModalButton = '#error-modal .modal-dialog .alert button[data-dismiss="modal"]'
this.errorModalButton = '#error-modal .modal-dialog .alert button[data-dismiss="modal"]';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SelectionPage extends BOBasePage implements ModuleManagerSelectionPageInte
async installModule(page: Page, moduleTag: string): Promise<boolean> {
await page.locator(this.searchInput).fill(moduleTag);
await page.locator(this.searchButton).click();
await this.elementVisible(page, this.installModuleButton(moduleTag), 3000)
await this.elementVisible(page, this.installModuleButton(moduleTag), 3000);
await page.locator(this.installModuleButton(moduleTag)).click();

return this.elementNotVisible(page, this.installModuleButton(moduleTag), 3000);
Expand Down

0 comments on commit 43dbc11

Please sign in to comment.