This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test that shallow tests most views in catwalk
- Loading branch information
Fredrik Folkesson
authored and
Fredrik Folkesson
committed
Jan 24, 2019
1 parent
d674d30
commit e09c3f1
Showing
8 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+233 KB
test/e2e/__artifacts__/baseline/make-another-selection-in-selection-bar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,83 @@ | ||
const wsHelper = require('./test-helper'); | ||
|
||
const host = process.env.CI === 'true' ? 'localhost' : 'host.docker.internal'; | ||
const engine = process.env.CI === 'true' ? 'localhost' : 'qix-engine'; | ||
const app = process.env.DocID || 'drugcases.qvf'; | ||
|
||
const url = `http://${host}:1234/?engine_url=ws://${engine}:9076/${app}`; | ||
const OPTS = { | ||
artifactsPath: 'test/e2e/__artifacts__/', | ||
}; | ||
let page; | ||
|
||
describe('usage', () => { | ||
beforeEach(async () => { | ||
page = await browser.newPage(); | ||
const client = page._client; | ||
await client.send('Animation.setPlaybackRate', { playbackRate: 1000 }); | ||
|
||
wsHelper.init(client); | ||
}); | ||
|
||
it('should support basic usage functions', async () => { | ||
await page.goto(url, { timeout: 60000, waitUntil: 'networkidle0' }); | ||
|
||
// Wait until the app has loaded data from engine | ||
await page.waitForSelector('.model'); | ||
await wsHelper.waitUntilNoRequests(500); | ||
|
||
// 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'); | ||
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'); | ||
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(500); | ||
|
||
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(500); | ||
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="# Countries"]'); | ||
await page.click('[title="Add another column"]'); | ||
await page.click('[data-title="# Death by primary suspect"]'); | ||
await wsHelper.waitUntilNoRequests(500); | ||
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('.topbarLogo', { button: 'right' }); | ||
page.waitForSelector('.react-contextmenu-item'); | ||
img = await page.screenshot({ fullPage: true }); | ||
await expect(img).to.matchImageOf('opened-menu', OPTS); | ||
}); | ||
}); |