-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #514 from adobecom/MWPW-138749
MWPW 138749 Visual tests for merch cards
- Loading branch information
Showing
29 changed files
with
165 additions
and
15 deletions.
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,46 @@ | ||
name: Integration Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
testCodeBranch: | ||
description: 'Test Code Branch' | ||
required: true | ||
default: 'stage' | ||
type: string | ||
|
||
jobs: | ||
run-integration-tests: | ||
name: Integration Tests | ||
runs-on: macos-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.testCodeBranch }} | ||
|
||
- name: Cache dependencies | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }}-${{ runner.os }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Install browsers | ||
run: npx playwright install | ||
|
||
- name: Run the tests | ||
run: npm run int3 | ||
|
||
- name: Save test logs | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: screenshots | ||
path: | | ||
test/integration/*/screenshots/**/*.test.png | ||
test/integration/*/screenshots/**/*.diff.png |
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
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
Binary file modified
BIN
-9.22 KB
(71%)
test/integration/accordian/screenshots/accordian-desktop/Chromium/collapsed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-51 KB
(44%)
test/integration/accordian/screenshots/accordian-desktop/Chromium/expanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.47 KB
(84%)
test/integration/accordian/screenshots/accordian-desktop/Firefox/collapsed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-42.4 KB
(50%)
test/integration/accordian/screenshots/accordian-desktop/Firefox/expanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.31 KB
(84%)
test/integration/accordian/screenshots/accordian-desktop/Webkit/collapsed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-39.7 KB
(50%)
test/integration/accordian/screenshots/accordian-desktop/Webkit/expanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-8.91 KB
(72%)
test/integration/accordian/screenshots/accordian-mobile/Chromium/collapsed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54.7 KB
(44%)
test/integration/accordian/screenshots/accordian-mobile/Chromium/expanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.3 KB
(85%)
test/integration/accordian/screenshots/accordian-mobile/Firefox/collapsed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-45.2 KB
(49%)
test/integration/accordian/screenshots/accordian-mobile/Firefox/expanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.17 KB
(85%)
test/integration/accordian/screenshots/accordian-mobile/Webkit/collapsed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-43 KB
(50%)
test/integration/accordian/screenshots/accordian-mobile/Webkit/expanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 @@ | ||
<main> | ||
<div> | ||
<div> | ||
<p><a href="https://milo.adobe.com/tools/ost?osi=sGuhzGARPVTnzdnxJoJtBSqD0LRP-UC3dQsLP_bCnc8&offerId=97F188FD9FB6837C883AA6ED8C3EE69D&type=checkoutUrl&text=buy-now">Start free 7-day trial</a></p> | ||
</div> | ||
</div> | ||
</main> |
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,43 @@ | ||
/* eslint-disable func-names */ | ||
import { | ||
readFile, | ||
setViewport, | ||
executeServerCommand, | ||
} from '@web/test-runner-commands'; | ||
import { expect } from '@esm-bundle/chai'; | ||
import { waitFor, delay } from '../../helpers/waitfor.js'; | ||
|
||
const screenshotFolder = 'test/integration/merch-card/screenshots'; | ||
|
||
describe('ost', function () { | ||
const suiteName = this.title; | ||
let testName; | ||
let screenshotPath; | ||
|
||
before(async () => { | ||
await executeServerCommand('page-route', { url: 'https://wcs.adobe.com/**/*' }); | ||
|
||
document.head.innerHTML = await readFile({ path: '../mocks/head.html' }); | ||
document.body.innerHTML = await readFile({ path: './mocks/body_ost.html' }); | ||
await setViewport({ width: 200, height: 50 }); | ||
await import('../../../acrobat/scripts/scripts.js'); | ||
await waitFor(() => document.querySelector('.placeholder-resolved'), 10000, 1000); | ||
await delay(1000); | ||
}); | ||
|
||
after(async () => { | ||
await executeServerCommand('page-unroute', { url: 'https://wcs.adobe.com/**/*' }); | ||
}); | ||
|
||
beforeEach(function () { | ||
testName = this.currentTest.title; | ||
screenshotPath = `${screenshotFolder}/${suiteName}/$browser/${testName}.png`; | ||
}); | ||
|
||
it('buy', async () => { | ||
const button = document.querySelector('.placeholder-resolved'); | ||
const href = button.getAttribute('href'); | ||
expect(href).to.match(/^https:\/\/commerce\.adobe\.com/); | ||
await executeServerCommand('diff-screenshot', { path: screenshotPath }); | ||
}); | ||
}); |
Binary file modified
BIN
+993 Bytes
(100%)
test/integration/merch-card/screenshots/merch_cards_desktop/Chromium/price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+567 Bytes
(100%)
test/integration/merch-card/screenshots/merch_cards_desktop/Firefox/price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
test/integration/merch-card/screenshots/merch_cards_desktop/Webkit/price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.28 KB
(100%)
test/integration/merch-card/screenshots/merch_cards_mobile/Chromium/price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.79 KB
(100%)
test/integration/merch-card/screenshots/merch_cards_mobile/Firefox/price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4 Bytes
(100%)
test/integration/merch-card/screenshots/merch_cards_mobile/Webkit/price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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