refactor categorical controls state (#1549)

* refactor categorical controls state

* lint

* fix race condition in tests

* fix typo

* add missing update on subset

* remove obsolete code

* update jest and puppeteer major version; update all minors

* update when label changes

* remove lint from tests; increase timeouts in e2e tests

* changes in response to PR review

* lint

* more PR comment changes

* more PR comment fixes

* lint

* more PR comment resolutions
This commit is contained in:
Bruce Martin
2020-06-10 12:56:38 -07:00
committed by GitHub
parent f063708b33
commit bc7a712048
25 changed files with 5097 additions and 3510 deletions
+8 -4
View File
@@ -1,6 +1,6 @@
import { strict as assert } from "assert";
export const cellxgeneActions = (page, utils) => ({
const cellxgeneActions = (page, utils) => ({
async drag(testId, start, end, lasso = false) {
const layout = await utils.waitByID(testId);
const elBox = await layout.boxModel();
@@ -31,14 +31,16 @@ export const cellxgeneActions = (page, utils) => ({
async getAllHistograms(testclass, testIds) {
const histTestIds = testIds.map((tid) => `histogram-${tid}`);
// these load asynchronously, so we need to wait for each histogram individually
await utils.waitForAllByIds(histTestIds);
// these load asynchronously, so we need to wait for each histogram individually,
// and they may be quite slow in some cases.
await utils.waitForAllByIds(histTestIds, { timeout: 240000 });
const allHistograms = await utils.getAllByClass(testclass);
return allHistograms.map((hist) => hist.replace(/^histogram-/, ""));
},
async getAllCategoriesAndCounts(category) {
await utils.waitByClass("categorical-row");
// these load asynchronously, so we have to wait for the specific category.
await utils.waitByID(`category-${category}`);
return page.$$eval(
`[data-testid="category-${category}"] [data-testclass='categorical-row']`,
(rows) =>
@@ -222,3 +224,5 @@ export const cellxgeneActions = (page, utils) => ({
await page.keyboard.press("Enter");
},
});
export default cellxgeneActions;