Skip to content

Commit

Permalink
Merge branch 'main' into saucelabs-integ
Browse files Browse the repository at this point in the history
  • Loading branch information
amauch-adobe authored Dec 9, 2023
2 parents 7e8b1ca + fede581 commit 6a398dc
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 16 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/blog.daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Blog Nala Daily Run

on:
schedule:
- cron: "30 15 * * *"
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: 'Blog 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 blog
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
3 changes: 2 additions & 1 deletion .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Milo Nala Daily Run
on:
schedule:
- cron: "0 16 * * *"
workflow_dispatch:

jobs:
platform_matrix:
Expand All @@ -17,7 +18,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v3
- name: Run Nala ${{ matrix.os }}
uses: ./
uses: ../
env:
IMS_EMAIL: ${{ secrets.IMS_EMAIL }}
IMS_PASS: ${{ secrets.IMS_PASS }}
Expand Down
3 changes: 2 additions & 1 deletion configs/blog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const envs = require('../envs/envs.js');
const config = {
testDir: '../tests/blog',
outputDir: '../test-results',
globalSetup: '../global.setup.js',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
expect: {
Expand All @@ -30,7 +31,7 @@ const config = {
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: process.env.CI
? [['github'], ['../utils/reporters/json-reporter.js'], ['../utils/reporters/json-reporter.js']]
: [['html', { outputFolder: 'test-html-results' }]],
: [['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). */
Expand Down
2 changes: 1 addition & 1 deletion features/milo/header.block.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
path: [
'/drafts/nala/blocks/header/feds-header-page',
],
tags: '@milo @feds @header @smoke @regression',
tags: '@milo @feds @header @nopr @smoke @regression',
},
],
};
29 changes: 26 additions & 3 deletions selectors/blog/home.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,38 @@ export default class BlogHomePage {
this.gnavProfile = this.page.locator('.gnav-profile');
this.signIn = this.gnavProfile.locator('.gnav-signin');

// Marquee block locators
this.marquee = this.page.locator('.marquee.dark').nth(0);
this.marqueeTextH1 = this.marquee.locator('h1').nth(0);
this.marqueeActionBlueButton = this.marquee.locator('a').nth(0);

// Featured article block locators
this.featuredArticleBlock = this.page.locator('.featured-article');
this.featuredArticleCard = this.featuredArticleBlock.locator('.featured-article-card');
this.featuredArticleImage = this.featuredArticleBlock.locator('.featured-article-card-image');

// Text block locators
this.textBlock = this.page.locator('.text.text-block.con-block');
this.textBlockHeader = this.textBlock.locator('#the-latest-news');
this.readMoreNewsButton = this.textBlock.locator('.con-button.outline');
this.textBlock1 = this.page.locator('.text.text-block.con-block').nth(0);
this.textBlock1Header = this.textBlock1.locator('h3');
this.textBlock1OutlineButton = this.textBlock1.locator('.con-button.outline');
this.readMoreNewsButton = this.textBlock1.locator('.con-button.outline');

// Consonant Card locators
this.consonantCard1 = this.page.locator('.card.consonant-Card').nth(0);
this.consonantCard1Image = this.consonantCard1.locator('.consonant-OneHalfCard-img').nth(0);
this.consonantCard1H3Text = this.consonantCard1.locator('.consonant-OneHalfCard-inner h3');
this.consonantCard1Text = this.consonantCard1.locator('.consonant-OneHalfCard-text');

this.consonantCard2 = this.page.locator('.card.consonant-Card').nth(1);
this.consonantCard2Image = this.consonantCard2.locator('.consonant-OneHalfCard-img').nth(0);
this.consonantCard2H3Text = this.consonantCard2.locator('.consonant-OneHalfCard-inner h3');
this.consonantCard2Text = this.consonantCard2.locator('.consonant-OneHalfCard-text');

this.consonantCard3 = this.page.locator('.card.consonant-Card').nth(2);
this.consonantCard3Image = this.consonantCard3.locator('.consonant-OneHalfCard-img').nth(0);
this.consonantCard3H3Text = this.consonantCard3.locator('.consonant-OneHalfCard-inner h3');
this.consonantCard3Text = this.consonantCard3.locator('.consonant-OneHalfCard-text');


// Article feed block locators
this.articleFeedBlock = this.page.locator('.article-feed.appear');
Expand Down
35 changes: 27 additions & 8 deletions tests/blog/homepage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,33 @@ test.describe('Blog Home page test suite', () => {
});

await test.step('step-3: Verify Articles', async () => {
// Featured article section
await expect(homePage.featuredArticleBlock).toBeVisible();
await expect(homePage.featuredArticleCard).toBeVisible();
await expect(homePage.featuredArticleImage).toBeVisible();
// Latest news text section
await expect(homePage.textBlock).toBeVisible();
await expect(homePage.textBlockHeader).toBeVisible();
await expect(homePage.readMoreNewsButton).toBeVisible();
// article section (Text Block)
await expect(homePage.marquee).toBeVisible();
await expect(homePage.marqueeTextH1).toBeVisible();
await expect(homePage.marqueeActionBlueButton).toBeVisible();

// article section (Text Block)
await expect(homePage.textBlock1).toBeVisible();
await expect(homePage.textBlock1Header).toBeVisible();
await expect(homePage.textBlock1OutlineButton).toBeVisible();

// consonant cards section
await expect(homePage.consonantCard1).toBeVisible();
await expect(homePage.consonantCard1Image).toBeVisible();
await expect(homePage.consonantCard1H3Text).toBeVisible();
await expect(homePage.consonantCard1Text).toBeVisible();

await expect(homePage.consonantCard2).toBeVisible();
await expect(homePage.consonantCard2Image).toBeVisible();
await expect(homePage.consonantCard2H3Text).toBeVisible();
await expect(homePage.consonantCard2Text).toBeVisible();

await expect(homePage.consonantCard3).toBeVisible();
await expect(homePage.consonantCard3Image).toBeVisible();
await expect(homePage.consonantCard3H3Text).toBeVisible();
await expect(homePage.consonantCard3Text).toBeVisible();


// Article feeds section
await webUtil.scrollPage('down', 'slow');
await page.waitForLoadState('networkidle');
Expand Down
2 changes: 1 addition & 1 deletion tests/milo/marquee.block.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import MarqueeBlock from '../../selectors/milo/marquee.block.page.js';
let webUtil;
let marquee;
let consoleErrors = [];
const knownConsoleErrors = ['Access-Control-Allow-Origin','Failed to load resource: net::ERR_FAILED'];
const knownConsoleErrors = ['Access-Control-Allow-Origin','Failed to load resource: net::ERR_FAILED','adobeid-na1-stg1.services'];

test.describe('Milo Marquee Block test suite', () => {
test.beforeEach(async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/milo/media.block.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import MediaBlock from '../../selectors/milo/media.block.page.js';
let webUtil;
let media;
let consoleErrors = [];
const knownConsoleErrors = ['Access-Control-Allow-Origin','Failed to load resource: net::ERR_FAILED'];
const knownConsoleErrors = ['Access-Control-Allow-Origin','Failed to load resource: net::ERR_FAILED','adobeid-na1-stg1.services'];

test.describe('Milo Media Block test suite', () => {
test.beforeEach(async ({ page }) => {
Expand Down

0 comments on commit 6a398dc

Please sign in to comment.