Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test commit to see if e2e tests work in GH actions #86

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.13.1
- name: Chrome
uses: browser-actions/setup-chrome@v1
- run: chrome --version
- name: Install
run: npm ci
- name: E2E
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
detect_chromedriver_version=true
26 changes: 25 additions & 1 deletion e2e-tests/specs/all.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const config = {
let serverPath = 'https://adobecom.github.io/caas';
const args = process.argv.slice(2);
if (args.includes('env=LOCAL')) {
serverPath = `http://localhost:${PORT}`;
serverPath = `http://caas.corp.adobe.com:${PORT}`;
config.collection.endpoint = '../../mock-json/smoke.json';
}

Expand Down Expand Up @@ -305,6 +305,30 @@ describe('Hide CTA(s):', async () => {
expect(taggedCta).toEqual(false);
expect(untaggedCta).toEqual(true);
});

it('Test floodgate card appears', async () => {
const cloneConfig = structuredClone(config);
cloneConfig.headers = [['x-adobe-floodgate', 'pink']];
cloneConfig.collection.endpoint = 'https://14257-chimera-sanrai.adobeioruntime.net/api/v1/web/chimera-0.0.1/collection?originSelection=doccloud&contentTypeTags=&collectionTags=&excludeContentWithTags=&language=en&country=us&complexQuery=&excludeIds=&currentEntityId=&featuredCards=6c43fa56-7f27-39ae-af30-9fb18e0e5050&environment=&draft=false&size=100000&flatFile=false';
const state = btoa(JSON.stringify(cloneConfig));
const url = `${serverPath}/html/e2e/floodgate-on.html?state=${state}`;
await browser.url(url);
await browser.setTimeout({ script: 50000 });
const cardTitle = await $('#\\32 tcmicr .consonant-OneHalfCard-title').getText();
expect(cardTitle).toEqual('Floodgate Headline');
});

it('Test floodgate card does not appear', async () => {
const cloneConfig = structuredClone(config);
cloneConfig.headers = [[]];
cloneConfig.collection.endpoint = 'https://14257-chimera-sanrai.adobeioruntime.net/api/v1/web/chimera-0.0.1/collection?originSelection=doccloud&contentTypeTags=&collectionTags=&excludeContentWithTags=&language=en&country=us&complexQuery=&excludeIds=&currentEntityId=&featuredCards=6c43fa56-7f27-39ae-af30-9fb18e0e5050&environment=&draft=false&size=100000&flatFile=false';
const state = btoa(JSON.stringify(cloneConfig));
const url = `${serverPath}/html/e2e/floodgate-off.html?state=${state}`;
await browser.url(url);
await browser.setTimeout({ script: 50000 });
const cardTitle = await $('#\\32 tcmicr .consonant-OneHalfCard-title').isExisting();
expect(cardTitle).toBe(false);
});
});

describe('Carousel', async () => {
Expand Down
Loading