generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MWPW-160756: Setup Nala tests for studio
- Loading branch information
Showing
14 changed files
with
1,292 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Nala' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
|
||
- run: $GITHUB_ACTION_PATH/pr.run.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"Create Nala Spec": { | ||
"prefix": "create nala spec", | ||
"body": [ | ||
"module.exports = {", | ||
" FeatureName: '${1:Block or Feature Name}',", | ||
" features: [", | ||
" {", | ||
" tcid: '0',", | ||
" name: '@${2:spec-name}',", | ||
" path: '/drafts/nala/[${3:test-page-path}]',", | ||
" data: {", | ||
" attribute-1: '${4:value}',", | ||
" attribute-2: '${5:value}',", | ||
" attribute-3: '${6:value}',", | ||
" },", | ||
" tags: '@Block @smoke @regression @dme',", | ||
" },", | ||
" ],", | ||
"};" | ||
], | ||
"description": "Create a Nala spec with block name or feature name" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint-disable */ | ||
import pkg from 'axios'; | ||
|
||
const { head } = pkg; | ||
export async function isBranchURLValid(url) { | ||
try { | ||
const response = await head(url); | ||
if (response.status === 200) { | ||
console.info(`\nURL (${url}) returned a 200 status code. It is valid.`); | ||
return true; | ||
} else { | ||
console.info(`\nURL (${url}) returned a non-200 status code (${response.status}). It is invalid.`); | ||
return false; | ||
} | ||
} catch (error) { | ||
console.info(`\nError checking URL (${url}): returned a non-200 status code (${response.status})`); | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable import/no-import-module-exports */ | ||
import { expect } from '@playwright/test'; | ||
|
||
async function fillOutSignInForm(props, page) { | ||
expect(process.env.IMS_EMAIL, 'ERROR: No environment variable for email provided for IMS Test.').toBeTruthy(); | ||
expect(process.env.IMS_PASS, 'ERROR: No environment variable for password provided for IMS Test.').toBeTruthy(); | ||
|
||
await expect(page).toHaveTitle(/Adobe ID/); | ||
let heading = await page.locator('.spectrum-Heading1').first().innerText(); | ||
expect(heading).toBe('Sign in'); | ||
|
||
// Fill out Sign-in Form | ||
await expect(async () => { | ||
await page.locator('#EmailPage-EmailField').fill(process.env.IMS_EMAIL); | ||
await page.locator('[data-id=EmailPage-ContinueButton]').click(); | ||
await expect(page.locator('text=Reset your password')).toBeVisible({ timeout: 45000 }); // Timeout accounting for how long IMS Login page takes to switch form | ||
}).toPass({ | ||
intervals: [1_000], | ||
timeout: 10_000, | ||
}); | ||
|
||
heading = await page.locator('.spectrum-Heading1', { hasText: 'Enter your password' }).first().innerText(); | ||
expect(heading).toBe('Enter your password'); | ||
await page.locator('#PasswordPage-PasswordField').fill(process.env.IMS_PASS); | ||
await page.locator('[data-id=PasswordPage-ContinueButton]').click(); | ||
await page.locator('div.ActionList-Item:nth-child(1)').click(); | ||
await page.waitForURL(`${props.url}#`); | ||
await expect(page).toHaveURL(`${props.url}#`); | ||
} | ||
|
||
export default { fillOutSignInForm }; |
Oops, something went wrong.