Skip to content

Commit

Permalink
Milo Libs runs
Browse files Browse the repository at this point in the history
  • Loading branch information
nateekar committed Jan 6, 2024
1 parent 1e257a7 commit b31ef68
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/milolib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Run Nala on Milo Libs Manually

on:
workflow_dispatch:
inputs:
branch:
description: 'Provide the branch url'
required: false
type: string
milolibs:
description: 'Provide MiloLibs param'
required: false
type: string
tags:
description: 'Test scenario tags, if empty all tests will run. i.e., @marquee'
required: false
type: string
platform:
description: 'Platform to run tests on; select one, options: [ubuntu-latest, windows-latest, macos-latest]'
required: true
type: string

jobs:
action:
name: Running tests
runs-on: ${{ inputs.platform }}

steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set permissions
run: chmod +x ./path/to/run.sh
- name: Set environment variables
run: |
echo "PR_BRANCH_LIVE_URL_GH=${{ github.event.inputs.branch }}" >> $GITHUB_ENV
echo "MILO_LIBS=${{ github.event.inputs.milolibs }}" >> $GITHUB_ENV
- name: Run Nala ${{ inputs.platform }}
uses: ./
env:
labels: ${{ inputs.tags }}
IMS_EMAIL: ${{ secrets.IMS_EMAIL }}
IMS_PASS: ${{ secrets.IMS_PASS }}
HLX_TKN: ${{ secrets.HLX_TKN }}
SLACK_WH: ${{ secrets.SLACK_WH }}
- name: Persist JSON Artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: nala-results
path: nala-results.json
retention-days: 30
7 changes: 4 additions & 3 deletions tests/milo/accordion.block.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import AccordionBlock from '../../selectors/milo/accordion.block.page.js';
let webUtil;
let accordion;
let consoleErrors = [];
let miloLib = '?milolibs=stage';
const knownConsoleErrors = ['Access-Control-Allow-Origin','Failed to load resource: net::ERR_FAILED'];

test.describe('Milo Accordion Block test suite', () => {
Expand All @@ -26,13 +27,13 @@ test.describe('Milo Accordion Block test suite', () => {

// Test 0 : Accordion
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[0].path}`);
console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLib}`);
const { data } = features[0];

await test.step('step-1: Go to Accordion block test page', async () => {
await page.goto(`${baseURL}${features[0].path}`);
await page.goto(`${baseURL}${features[0].path}${miloLib}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[0].path}`);
await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLib}`);
});

await test.step('step-2: Verify Accrodion block content/specs', async () => {
Expand Down

0 comments on commit b31ef68

Please sign in to comment.