Skip to content

Commit

Permalink
Checkpages (#427)
Browse files Browse the repository at this point in the history
* check Express pages are up

* check Express pages are up 2

* add firefox option

* use expect.soft

* restoring package-lock.json version

* revert package-lock.json

* add express tag

* fix lint errors

---------

Co-authored-by: Haris Bijli <[email protected]>
  • Loading branch information
hadobe and Haris Bijli committed Sep 3, 2024
1 parent fed2903 commit 833a358
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/express.daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Express Nala Daily Run

on:
schedule:
- cron: '0 16 * * *'
workflow_dispatch:

jobs:
platform_matrix:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
name: Running tests
runs-on: ${{ matrix.os }}
env:
WORKFLOW_NAME: 'Express Nala Daily Run'
DAILY_RUN: 'true'

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Run Nala ${{ matrix.os }}
run: bash dailyrun.sh express
env:
IMS_EMAIL: ${{ secrets.IMS_EMAIL }}
IMS_PASS: ${{ secrets.IMS_PASS }}
HLX_TKN: ${{ secrets.HLX_TKN }}
SLACK_WH: ${{ secrets.SLACK_WH }}

- name: Display workflow name
run: echo "The workflow name is $WORKFLOW_NAME"

- name: Persist JSON Artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: nala-results
path: nala-results.json
retention-days: 30
64 changes: 64 additions & 0 deletions configs/express.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const { devices } = require('@playwright/test');

const envs = require('../envs/envs.js');

/**
* @see https://playwright.dev/docs/test-configuration
* @type {import('@playwright/test').PlaywrightTestConfig}
*/
const config = {
testDir: '../tests/express',
outputDir: '../test-results',
globalSetup: '../global.setup.js',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000,
},
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 1 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 4 : 3,
/* Reporter to use. */
reporter: process.env.CI
? [['github'], ['list'], ['../utils/reporters/base-reporter.js']]
: [['html', { outputFolder: 'test-html-results' }], ['list'], ['../utils/reporters/base-reporter.js']],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 60000,

trace: 'on-first-retry',
// eslint-disable-next-line max-len
baseURL: envs['@express_live'] || 'https://main--express--adobecom.hlx.live',
},

/* Configure projects for major browsers */
projects: [
{
name: 'express-live-chromium',
use: {
...devices['Desktop Chrome'],
baseURL: envs['@express_live'],
},
},

{
name: 'express-live-firefox',
use: {
...devices['Desktop Firefox'],
baseURL: envs['@express_live'],
},
},
],
};

module.exports = config;
2 changes: 2 additions & 0 deletions envs/envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ module.exports = {
'@helpx_live': 'https://helpx-internal.stage.adobe.com',
'@dx_stage': 'https://stage--dx-partners--adobecom.hlx.live',
'@dme_stage': 'https://stage--dme-partners--adobecom.hlx.live',
'@express_stage': 'https://stage--express--adobecom.hlx.live/express/',
'@express_live': 'https://main--express--adobecom.hlx.live/express/',
};
76 changes: 76 additions & 0 deletions features/express/important-pages.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module.exports = {
name: 'Important Express pages',
features: [
{
tcid: '0',
name: '@express-imp-pages',
path: [
'',
'create/story/instagram',
'create/video/instagram/reel',
'create/post/instagram',
'create/video/tiktok',
'create/story/facebook',
'create/post/facebook',
'create/video/youtube',
'create/thumbnail/youtube',
'create/banner/youtube',
'create/meme',
'create/poster',
'create/brochure',
'create/invitation',
'create/menu',
'create/card',
'create/certificate',
'create/resume',
'create/invoice',
'feature/image/qr-code-generator',
'create/print/flyer',
'create/print/poster',
'create/print/card',
'create/print/invitation',
'create/print/business-card',
'create/print/t-shirt',
'print',
'feature/content-scheduler',
'create/business-card',
'create/flyer',
'create/logo',
'create/advertisement',
'create/photo-collage',
'create/presentation',
'create/profile-picture',
'create',
'feature/image/editor',
'feature/video/editor',
'templates',
'feature/image/remove-background',
'feature/image/resize',
'feature/image/convert/png-to-jpg',
'feature/image/convert/jpg-to-png',
'feature/image/convert/jpg-to-svg',
'feature/image/crop',
'feature/video/convert/video-to-gif',
'feature/video/crop',
'feature/video/trim',
'feature/video/resize',
'feature/video/merge',
'feature/video/convert/mp4',
'feature/video/animate/audio',
'feature/video/add-caption',
'feature',
'feature/video/remove-background',
'business/teams',
'business',
'nonprofits',
'entitled',
'business#sales-contact-form-1',
'#open-jarvis-chat',
'learn/students',
'pricing',

],
tags: '@regression @express',
},
],
};
15 changes: 15 additions & 0 deletions tests/express/check-important-pages.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { expect, test } from '@playwright/test';
import { features } from '../../features/express/important-pages.spec.js';

test.describe('Verify pages are up', () => {
for (const path of features[0].path) {
test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => {
await test.step('Verify response', async () => {
const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' });

Check failure on line 8 in tests/express/check-important-pages.test.js

View workflow job for this annotation

GitHub Actions / Running tests (ubuntu-latest)

[express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages

1) [express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages,templates @regression @express › Verify response Error: page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://main--express--adobecom.hlx.live/express/templates Call log: - navigating to "https://main--express--adobecom.hlx.live/express/templates", waiting until "domcontentloaded" 6 | test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => { 7 | await test.step('Verify response', async () => { > 8 | const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' }); | ^ 9 | const statusCode = response.status(); 10 | expect.soft(statusCode).toBe(200); 11 | console.info(`HTTP Status Code: ${statusCode}`); at /home/runner/work/nala/nala/tests/express/check-important-pages.test.js:8:37 at /home/runner/work/nala/nala/tests/express/check-important-pages.test.js:7:18

Check failure on line 8 in tests/express/check-important-pages.test.js

View workflow job for this annotation

GitHub Actions / Running tests (ubuntu-latest)

[express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages

1) [express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages,templates @regression @express › Verify response Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://main--express--adobecom.hlx.live/express/templates Call log: - navigating to "https://main--express--adobecom.hlx.live/express/templates", waiting until "domcontentloaded" 6 | test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => { 7 | await test.step('Verify response', async () => { > 8 | const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' }); | ^ 9 | const statusCode = response.status(); 10 | expect.soft(statusCode).toBe(200); 11 | console.info(`HTTP Status Code: ${statusCode}`); at /home/runner/work/nala/nala/tests/express/check-important-pages.test.js:8:37 at /home/runner/work/nala/nala/tests/express/check-important-pages.test.js:7:18

Check failure on line 8 in tests/express/check-important-pages.test.js

View workflow job for this annotation

GitHub Actions / Running tests (ubuntu-latest)

[express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages

2) [express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages,feature/video/animate/audio @regression @express › Verify response Error: page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://main--express--adobecom.hlx.live/express/feature/video/animate/audio Call log: - navigating to "https://main--express--adobecom.hlx.live/express/feature/video/animate/audio", waiting until "domcontentloaded" 6 | test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => { 7 | await test.step('Verify response', async () => { > 8 | const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' }); | ^ 9 | const statusCode = response.status(); 10 | expect.soft(statusCode).toBe(200); 11 | console.info(`HTTP Status Code: ${statusCode}`); at /home/runner/work/nala/nala/tests/express/check-important-pages.test.js:8:37 at /home/runner/work/nala/nala/tests/express/check-important-pages.test.js:7:18

Check failure on line 8 in tests/express/check-important-pages.test.js

View workflow job for this annotation

GitHub Actions / Running tests (ubuntu-latest)

[express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages

2) [express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages,feature/video/animate/audio @regression @express › Verify response Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://main--express--adobecom.hlx.live/express/feature/video/animate/audio Call log: - navigating to "https://main--express--adobecom.hlx.live/express/feature/video/animate/audio", waiting until "domcontentloaded" 6 | test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => { 7 | await test.step('Verify response', async () => { > 8 | const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' }); | ^ 9 | const statusCode = response.status(); 10 | expect.soft(statusCode).toBe(200); 11 | console.info(`HTTP Status Code: ${statusCode}`); at /home/runner/work/nala/nala/tests/express/check-important-pages.test.js:8:37 at /home/runner/work/nala/nala/tests/express/check-important-pages.test.js:7:18

Check failure on line 8 in tests/express/check-important-pages.test.js

View workflow job for this annotation

GitHub Actions / Running tests (macos-latest)

[express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages

1) [express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages,templates @regression @express › Verify response Error: page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://main--express--adobecom.hlx.live/express/templates Call log: - navigating to "https://main--express--adobecom.hlx.live/express/templates", waiting until "domcontentloaded" 6 | test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => { 7 | await test.step('Verify response', async () => { > 8 | const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' }); | ^ 9 | const statusCode = response.status(); 10 | expect.soft(statusCode).toBe(200); 11 | console.info(`HTTP Status Code: ${statusCode}`); at /Users/runner/work/nala/nala/tests/express/check-important-pages.test.js:8:37 at /Users/runner/work/nala/nala/tests/express/check-important-pages.test.js:7:18

Check failure on line 8 in tests/express/check-important-pages.test.js

View workflow job for this annotation

GitHub Actions / Running tests (macos-latest)

[express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages

1) [express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages,templates @regression @express › Verify response Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://main--express--adobecom.hlx.live/express/templates Call log: - navigating to "https://main--express--adobecom.hlx.live/express/templates", waiting until "domcontentloaded" 6 | test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => { 7 | await test.step('Verify response', async () => { > 8 | const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' }); | ^ 9 | const statusCode = response.status(); 10 | expect.soft(statusCode).toBe(200); 11 | console.info(`HTTP Status Code: ${statusCode}`); at /Users/runner/work/nala/nala/tests/express/check-important-pages.test.js:8:37 at /Users/runner/work/nala/nala/tests/express/check-important-pages.test.js:7:18

Check failure on line 8 in tests/express/check-important-pages.test.js

View workflow job for this annotation

GitHub Actions / Running tests (macos-latest)

[express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages

2) [express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages,feature/video/animate/audio @regression @express › Verify response Error: page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://main--express--adobecom.hlx.live/express/feature/video/animate/audio Call log: - navigating to "https://main--express--adobecom.hlx.live/express/feature/video/animate/audio", waiting until "domcontentloaded" 6 | test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => { 7 | await test.step('Verify response', async () => { > 8 | const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' }); | ^ 9 | const statusCode = response.status(); 10 | expect.soft(statusCode).toBe(200); 11 | console.info(`HTTP Status Code: ${statusCode}`); at /Users/runner/work/nala/nala/tests/express/check-important-pages.test.js:8:37 at /Users/runner/work/nala/nala/tests/express/check-important-pages.test.js:7:18

Check failure on line 8 in tests/express/check-important-pages.test.js

View workflow job for this annotation

GitHub Actions / Running tests (macos-latest)

[express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages

2) [express-live-chromium] › check-important-pages.test.js:6:9 › Verify pages are up › @express-imp-pages,feature/video/animate/audio @regression @express › Verify response Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://main--express--adobecom.hlx.live/express/feature/video/animate/audio Call log: - navigating to "https://main--express--adobecom.hlx.live/express/feature/video/animate/audio", waiting until "domcontentloaded" 6 | test(`${features[0].name},${path} ${features[0].tags}`, async ({ page, baseURL }) => { 7 | await test.step('Verify response', async () => { > 8 | const response = await page.goto(`${baseURL}${path}`, { waitUntil: 'domcontentloaded' }); | ^ 9 | const statusCode = response.status(); 10 | expect.soft(statusCode).toBe(200); 11 | console.info(`HTTP Status Code: ${statusCode}`); at /Users/runner/work/nala/nala/tests/express/check-important-pages.test.js:8:37 at /Users/runner/work/nala/nala/tests/express/check-important-pages.test.js:7:18
const statusCode = response.status();
expect.soft(statusCode).toBe(200);
console.info(`HTTP Status Code: ${statusCode}`);
});
});
}
});

0 comments on commit 833a358

Please sign in to comment.