Skip to content

Commit fe29dfb

Browse files
committed
Refactor login steps and update BrowserStack build name
Removed redundant navigation and page load logic from login steps and base page. Updated BrowserStack build name format in GitHub Actions workflow for clarity.
1 parent 6916c8d commit fe29dfb

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

.github/workflows/browserstack-ui-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
4141
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
4242
BROWSERSTACK_PROJECT_NAME: Playwright Testing Framework
43-
BROWSERSTACK_BUILD_NAME: build-${{ github.run_number }}-${{ github.sha }}
43+
BROWSERSTACK_BUILD_NAME: Playwright Build-${{ github.run_number }}-${{ github.sha }}
4444
BROWSERSTACK_SESSION_NAME: browserstack_${{ github.workflow }}
4545
BROWSERSTACK_DEBUG: true
4646
BROWSERSTACK_CONSOLE_LOGS: true

src/pages/base.page.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,4 @@ export class BasePage {
1919
console.log(`Navigating to: ${url}`); // Debug log
2020
await this.page.goto(url);
2121
}
22-
23-
async waitForPageLoad() {
24-
await this.page.waitForLoadState('networkidle');
25-
}
2622
}

src/steps/login.steps.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,10 @@ Given('I am on the login page', async function (this: World) {
88
await loginPage.navigate(process.env.BASE_URL);
99
});
1010

11-
When('I login with valid credentials', async function (this: World) {
12-
const loginPage = new LoginPage(this.page);
13-
await loginPage.navigate(process.env.BASE_URL);
14-
});
11+
When('I login with valid credentials', async function (this: World) {});
1512

16-
When('I login with invalid credentials', async function (this: World) {
17-
const loginPage = new LoginPage(this.page);
18-
await loginPage.navigate(process.env.BASE_URL);
19-
});
13+
When('I login with invalid credentials', async function (this: World) {});
2014

21-
Then('I should be logged in successfully', async function (this: World) {
22-
const loginPage = new LoginPage(this.page);
23-
await loginPage.navigate(process.env.BASE_URL);
24-
});
15+
Then('I should be logged in successfully', async function (this: World) {});
2516

26-
Then('I should see an error message', async function (this: World) {
27-
const loginPage = new LoginPage(this.page);
28-
await loginPage.navigate(process.env.BASE_URL);
29-
});
17+
Then('I should see an error message', async function (this: World) {});

0 commit comments

Comments
 (0)