Skip to content

Commit f1575f4

Browse files
committed
UserFacingLocators
1 parent deeb121 commit f1575f4

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"scripts": {
1010
"test": "cross-env ENV=%ENV% npx playwright test",
11-
"test:single": "cross-env ENV=%ENV% npx playwright test Login.test.ts --project=Chrome",
11+
"test:single": "cross-env ENV=%ENV% npx playwright test AlertsFrameWindows.test.ts --project=Chrome",
1212
"test:parallel": "cross-env ENV=%ENV% npx playwright test --grep @Smoke --project=Chrome",
1313
"test:serial": "cross-env ENV=%ENV% npx playwright test --grep @Smoke --workers=1 --project=Chrome",
1414
"test:serial:ci": "npx playwright test --grep @Smoke --workers=1 --project=Chrome",

‎pageFactory/pageRepository/ElementsPage.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class ElementsPage {
3232
this.SUBMIT_BUTTON = page.getByText(`Submit`);
3333
this.SUBMITTED_TEXT = page.getByText(`Name:AutoTest`, { exact: true }); // Matches exact text
3434
this.HOME_CHECK_BOX = page.getByText('Home');
35-
this.HOME_SELECTED_TEXT = page.locator(`.display-result`);
35+
this.HOME_SELECTED_TEXT = page.locator(`#result`);
3636
this.NO_RADIO_BUTTON = page.locator(`#noRadio`); // Using CSS Selector
3737
this.WEB_TABLES_HEADER = page.getByRole('columnheader');
3838
this.WEB_TABLES_EDIT_ICON = page.getByRole('row', { name: 'Cierra' }).getByTitle('Edit').locator('svg'); // Chaining Locators

‎pageFactory/pageRepository/LoginPage.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export class LoginPage {
1616
this.page = page;
1717
this.context = context;
1818
webActions = new WebActions(this.page, this.context);
19-
this.USERNAME_EDITBOX = page.locator('#userName');
20-
this.PASSWORD_EDITBOX = page.locator('#password');
21-
this.LOGIN_BUTTON = page.locator('#login');
19+
this.USERNAME_EDITBOX = page.getByPlaceholder('UserName');
20+
this.PASSWORD_EDITBOX = page.getByPlaceholder('Password');
21+
this.LOGIN_BUTTON = page.getByRole('button', { name: 'Login' });
2222
this.BOOKS_SEARCH_BOX = page.getByPlaceholder('Type to search');
2323
}
2424

‎pageFactory/pageRepository/WidgetsPage.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class WidgetsPage {
1515
this.context = context;
1616
this.AUTOCOMPLETE_EDITBOX = page.locator('#autoCompleteSingleInput');
1717
this.BLUE_COLOUR_TEXT = page.getByText('Blue', { exact: true }); //Used to select Blue colour from Autocomplete editbox
18-
this.HOVER_BUTTON = page.locator('#toolTipButton');
18+
this.HOVER_BUTTON = page.getByRole('button', { name: 'Hover me to see' });
1919
this.TOOL_TIP_TEXT = page.getByRole("tooltip");
2020
this.OLD_SELECT_MENU = page.locator('#oldSelectMenu');
2121
this.MULTISELECT_MENU = page.getByText('Select...');

0 commit comments

Comments
 (0)