Skip to content

Commit 61d21ba

Browse files
author
Shay
committed
Merge branch '235-github-actions-workflow-faalt' into 'main'
Resolve "Github actions workflow faalt" See merge request elgentos/magento2-playwright!37
2 parents 9d6b127 + 92e17c4 commit 61d21ba

File tree

4 files changed

+40
-17
lines changed

4 files changed

+40
-17
lines changed

.github/workflows/main.yml

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build-and-selftest:
1010
if: github.head_ref != 'gitlab-main'
11-
runs-on: windows-latest
11+
runs-on: ubuntu-latest
1212

1313
env:
1414
PLAYWRIGHT_BASE_URL: https://hyva-demo.elgentos.io/
@@ -41,31 +41,48 @@ jobs:
4141
with:
4242
node-version: 18
4343

44-
- name: Install dependencies
45-
run: npm install
46-
47-
- name: Install Playwright browsers
48-
run: npx playwright install --with-deps
49-
5044
- name: Copy config files
5145
run: |
5246
cp playwright.config.example.ts playwright.config.ts
5347
cp bypass-captcha.config.example.ts bypass-captcha.config.ts
54-
cp tests.config.example.ts tests.config.ts
5548
cp tsconfig.example.json tsconfig.json
5649
57-
- name: Run Playwright setup test
58-
run: npx playwright test --reporter=line --workers=4 tests/setup.spec.ts
50+
- name: Create testing suite environment
51+
run: |
52+
set -euo pipefail
53+
echo 'Setting up the testing environment'
54+
mkdir -p base-tests
55+
npm install
56+
npx playwright install-deps
57+
ls -l base-tests
58+
npx playwright test --grep "@setup" --reporter=line --workers=4 --max-failures=1
59+
shell: bash
5960
env:
60-
CI: true
61+
CI: true
62+
- uses: actions/upload-artifact@v4
63+
if: ${{ !cancelled() }}
64+
with:
65+
name: playwright-report
66+
path: playwright-report
67+
retention-days: 30
6168

6269
- name: Run Playwright tests
63-
run: npx playwright test --workers=4 --grep-invert "@setup" --max-failures=1
70+
run: |
71+
set -euo pipefail
72+
echo "Running tests from testing suite"
73+
npx playwright install --with-deps
74+
npx playwright test --workers=4 --grep-invert "@setup" --max-failures=1
6475
env:
65-
CI: true
76+
CI: true
77+
- uses: actions/upload-artifact@v4
78+
if: ${{ !cancelled() }}
79+
with:
80+
name: playwright-report
81+
path: playwright-report
82+
retention-days: 30
6683
- uses: actions/upload-artifact@v4
6784
if: ${{ !cancelled() }}
6885
with:
69-
name: playwright-report
70-
path: playwright-report/
71-
retention-days: 30
86+
name: test-results
87+
path: test-results
88+
retention-days: 30

tests/poms/adminhtml/magentoAdmin.page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class MagentoAdminPage {
186186
await customerConfigurationLink.waitFor();
187187
await customerConfigurationLink.click();
188188

189-
const captchaSettingsBlock = this.page.getByRole('link', { name: UIReference.configurationPage.captchaSectionLabel });
189+
const captchaSettingsBlock = this.page.getByRole('link', { name: UIReference.configurationPage.captchaSectionLabel }).filter({hasNotText: 'documentation'});
190190
const captchaSettingsSystemValueCheckbox = this.page.locator(UIReference.configurationPage.captchaSettingSystemCheckbox);
191191

192192
await captchaSettingsBlock.waitFor();

tests/poms/frontend/login.page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class LoginPage {
2727
await this.loginButton.press("Enter");
2828
// await this.loginButton.click({force: true});
2929

30+
await this.page.waitForURL(slugs.account.accountOverviewSlug);
31+
3032
// Open the menu, then check the 'Sign Out' button is visible
3133
await mainmenu.mainMenuAccountButton.waitFor();
3234
await mainmenu.mainMenuAccountButton.click();

tests/poms/frontend/product.page.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class ProductPage {
4343
await this.addToWishlistButton.click();
4444
await this.page.waitForLoadState();
4545

46+
await expect(async () => {
47+
await expect(this.page.getByText(addedToWishlistNotification)).toBeVisible();
48+
}).toPass();
49+
4650
let productNameInWishlist = this.page.locator(UIReference.wishListPage.wishListItemGridLabel).getByText(UIReference.productPage.simpleProductTitle, {exact: true});
4751

4852
await expect(this.page).toHaveURL(new RegExp(slugs.wishlist.wishListRegex));

0 commit comments

Comments
 (0)