Skip to content
Draft
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
40 changes: 36 additions & 4 deletions .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
PHP_VERSION: '8.1'
- PS_VERSION: '8.1.7'
PHP_VERSION: '8.1'
- PS_VERSION: '8.2.1'
PHP_VERSION: '8.1'
- PS_VERSION: '9.0.x'
PHP_VERSION: '8.2'
- PS_VERSION: 'nightly'
Expand All @@ -43,13 +45,41 @@ jobs:
with:
fetch-depth: 0

- name: Clone PrestaShop for core dependencies
run: |
git clone --depth=50 https://github.com/PrestaShop/PrestaShop.git ~/PrestaShop
rm -rf ~/PrestaShop/modules/blockwishlist
cd ..
mv blockwishlist ~/PrestaShop/modules
ln -s ~/PrestaShop/modules/blockwishlist
cd blockwishlist

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
node-version: 20.x

- name: Install dependencies
run: npm ci

- name: Build
run: npm install && npm run build
- name: Build PrestaShop assets
run: |
npm --prefix ~/PrestaShop/admin-dev/themes/new-theme install
npm --prefix ~/PrestaShop/admin-dev/themes/new-theme run build

- name: Build JS dependencies
run: |
npm --prefix ~/PrestaShop/modules/blockwishlist run build
rm -rf node_modules

- name: Install composer dependencies
run: composer install --no-dev -o

- name: Prepare auto-index tool
run: composer global require prestashop/autoindex

- name: Generate index.php
run: ~/.composer/vendor/bin/autoindex

- name: Build ZIP
run: |
Expand Down Expand Up @@ -84,7 +114,7 @@ jobs:
DB_NAME: 'prestashop'
DB_USER: 'prestashop'
DB_PASSWD: 'prestashop'
run: npx playwright test
run: npx playwright test campaigns/03_frontOffice/02_products/01_addProductToList.spec.ts

- name: Upload artifact report
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -122,6 +152,8 @@ jobs:
PHP_VERSION: '8.1'
- PS_VERSION: '8.1.7'
PHP_VERSION: '8.1'
- PS_VERSION: '8.2.1'
PHP_VERSION: '8.1'
- PS_VERSION: '9.0.x'
PHP_VERSION: '8.2'
- PS_VERSION: 'nightly'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,26 @@ test.describe('Wishlist module - Add a product to a list', async () => {
let page: Page;
let wishlistName: string;

test.beforeAll(async ({ browser }) => {
test.beforeAll(async ({ browser }, testInfo) => {
browserContext = await browser.newContext();
page = await browserContext.newPage();
});
test.afterAll(async () => {
page = await browser.newPage({
recordVideo: {
dir: testInfo.outputPath('videos'),
}
});
});
test.afterAll(async ({}, testInfo) => {
const videoPath = testInfo.outputPath('my-video.webm');
await Promise.all([
page.video()!.saveAs(videoPath),
page.close()
]);
testInfo.attachments.push({
name: 'video',
path: videoPath,
contentType: 'video/webm'
});

await page.close();
});

Expand Down
3 changes: 2 additions & 1 deletion tests/UI/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Capture screenshot after each test failure */
screenshot: 'only-on-failure',
screenshot: 'on',
video: 'on',
},

/* Configure projects for major browsers */
Expand Down
Loading