diff --git a/.github/workflows/express.daily.yml b/.github/workflows/express.daily.yml new file mode 100644 index 00000000..3b4855eb --- /dev/null +++ b/.github/workflows/express.daily.yml @@ -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 \ No newline at end of file diff --git a/configs/express.config.js b/configs/express.config.js new file mode 100644 index 00000000..f2e51a22 --- /dev/null +++ b/configs/express.config.js @@ -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; diff --git a/envs/envs.js b/envs/envs.js index 66a1f4fa..dc72c954 100644 --- a/envs/envs.js +++ b/envs/envs.js @@ -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/', }; diff --git a/features/express/important-pages.spec.js b/features/express/important-pages.spec.js new file mode 100644 index 00000000..2f2e9d29 --- /dev/null +++ b/features/express/important-pages.spec.js @@ -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', + }, + ], +}; diff --git a/tests/express/check-important-pages.test.js b/tests/express/check-important-pages.test.js new file mode 100644 index 00000000..46ab361f --- /dev/null +++ b/tests/express/check-important-pages.test.js @@ -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' }); + const statusCode = response.status(); + expect.soft(statusCode).toBe(200); + console.info(`HTTP Status Code: ${statusCode}`); + }); + }); + } +});