Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Revert again
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Strand committed Dec 18, 2019
1 parent 6eae11c commit 64005b7
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 89 deletions.
4 changes: 0 additions & 4 deletions test/e2e/_setup.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ beforeEach(async () => {
const engine = process.env.CI === 'true' ? 'localhost' : 'qix-engine';
const engineUrl = `http://${host}:1234/?engine_url=ws://${engine}:9076/`;

process.on('unhandledRejection', (err) => {
console.log('Unhandled rejection:', err);
});

const OPTS = {
artifactsPath: 'test/e2e/__artifacts__/',
};
Expand Down
28 changes: 14 additions & 14 deletions test/e2e/doc-list.spec.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
describe('doc-list', () => {
it('should show the no engine found with invalid engine url', async () => {
const incorrectEngineUrl = `http://${host}:1234/?engine_url=ws://incorrect-url:9076`;

await page.goto(incorrectEngineUrl, { timeout: 60000, waitUntil: 'networkidle0' });
await page.waitForSelector('[value=Connect]');
let img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('no-engine-doc-list', OPTS);

await page.click('.Collapsible__trigger');
await page.waitForSelector('.Collapsible__trigger.is-open');
await page.waitForFunction("document.querySelector('.Collapsible__contentOuter').clientHeight != 0");
img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('learn-more-info', OPTS);
});
// it('should show the no engine found with invalid engine url', async () => {
// const incorrectEngineUrl = `http://${host}:1234/?engine_url=ws://incorrect-url:9076`;
//
// await page.goto(incorrectEngineUrl, { timeout: 60000, waitUntil: 'networkidle0' });
// await page.waitForSelector('[value=Connect]');
// let img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('no-engine-doc-list', OPTS);
//
// await page.click('.Collapsible__trigger');
// await page.waitForSelector('.Collapsible__trigger.is-open');
// await page.waitForFunction("document.querySelector('.Collapsible__contentOuter').clientHeight != 0");
// img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('learn-more-info', OPTS);
// });

it('should show the doc list when a valid engine url is provided', async () => {
const correctEngineUrl = engineUrl;
Expand Down
142 changes: 71 additions & 71 deletions test/e2e/usage.spec.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
describe('usage', () => {
it('should support basic usage functions', async () => {
const app = process.env.DocID || 'drugcases.qvf';
const url = `http://${host}:1234/?engine_url=ws://${engine}:9076/${app}`;

await page.goto(url, { timeout: 60000, waitUntil: 'networkidle0' });

// Wait until the app has loaded data from engine
await page.waitForSelector('.model');
await wsHelper.waitUntilNoRequests(250);

// Skip tutorial
await page.click('[data-test-id=button-skip]');

// Make and verify a selection
await page.click('[fieldz=Key_Ind_Drug]');
await page.click('[title="\'10003554-1\' (No numerical representation)"]');
await page.waitForSelector('.selection-field');
await wsHelper.waitUntilNoRequests(250);
let img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('selection', OPTS);

// Show the extra information box
await page.click('.SVGInline.extra-information-icon');
await page.waitForSelector('h2');
await page.waitFor(200);
img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('extra-information-box', OPTS);

// Make another selection in the selection bar
await page.click('[aria-label=close]');
await page.click('.selection-field > .field');
await page.click('[title="\'10003554-2\' (No numerical representation)"]');
await wsHelper.waitUntilNoRequests(250);

img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('make-another-selection-in-selection-bar', OPTS);

// Clear selections
await page.click('.SVGInline.clear-selection');
await wsHelper.waitUntilNoRequests(250);
img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('cleared-selections', OPTS);

// Accept the cookies since the button is blocking opening of the hypercube
await page.click('.cookieConsent > button');

// Open hypercube view
await page.click('[title="Create a new hypercube"]');
img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('open-hypercube-view', OPTS);

// Create a hypercube
await page.click('[data-title="measures"]');
await page.click('[data-title="# Countries"]');
await page.click('[title="Add another column"]');
await page.click('[data-title="measures"]');
await page.waitForSelector('[data-title="# Death by primary suspect"]');
await page.click('[data-title="# Death by primary suspect"]');
await wsHelper.waitUntilNoRequests(250);
img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('created-hypercube', OPTS);

// Close hypercube and open menu
await page.click('.SVGInline.close');
await page.click('.menu-provider');
page.waitForSelector('.react-contexify');
img = await page.screenshot({ fullPage: true });
await expect(img).to.matchImageOf('opened-menu', OPTS);
});
});
// describe('usage', () => {
// it('should support basic usage functions', async () => {
// const app = process.env.DocID || 'drugcases.qvf';
// const url = `http://${host}:1234/?engine_url=ws://${engine}:9076/${app}`;
//
// await page.goto(url, { timeout: 60000, waitUntil: 'networkidle0' });
//
// // Wait until the app has loaded data from engine
// await page.waitForSelector('.model');
// await wsHelper.waitUntilNoRequests(250);
//
// // Skip tutorial
// await page.click('[data-test-id=button-skip]');
//
// // Make and verify a selection
// await page.click('[fieldz=Key_Ind_Drug]');
// await page.click('[title="\'10003554-1\' (No numerical representation)"]');
// await page.waitForSelector('.selection-field');
// await wsHelper.waitUntilNoRequests(250);
// let img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('selection', OPTS);
//
// // Show the extra information box
// await page.click('.SVGInline.extra-information-icon');
// await page.waitForSelector('h2');
// await page.waitFor(200);
// img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('extra-information-box', OPTS);
//
// // Make another selection in the selection bar
// await page.click('[aria-label=close]');
// await page.click('.selection-field > .field');
// await page.click('[title="\'10003554-2\' (No numerical representation)"]');
// await wsHelper.waitUntilNoRequests(250);
//
// img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('make-another-selection-in-selection-bar', OPTS);
//
// // Clear selections
// await page.click('.SVGInline.clear-selection');
// await wsHelper.waitUntilNoRequests(250);
// img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('cleared-selections', OPTS);
//
// // Accept the cookies since the button is blocking opening of the hypercube
// await page.click('.cookieConsent > button');
//
// // Open hypercube view
// await page.click('[title="Create a new hypercube"]');
// img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('open-hypercube-view', OPTS);
//
// // Create a hypercube
// await page.click('[data-title="measures"]');
// await page.click('[data-title="# Countries"]');
// await page.click('[title="Add another column"]');
// await page.click('[data-title="measures"]');
// await page.waitForSelector('[data-title="# Death by primary suspect"]');
// await page.click('[data-title="# Death by primary suspect"]');
// await wsHelper.waitUntilNoRequests(250);
// img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('created-hypercube', OPTS);
//
// // Close hypercube and open menu
// await page.click('.SVGInline.close');
// await page.click('.menu-provider');
// page.waitForSelector('.react-contexify');
// img = await page.screenshot({ fullPage: true });
// await expect(img).to.matchImageOf('opened-menu', OPTS);
// });
// });

0 comments on commit 64005b7

Please sign in to comment.