From 7ffa18a190b60f1c961a83d7781aca9045a38126 Mon Sep 17 00:00:00 2001
From: Zachary Foster
Date: Tue, 20 Oct 2020 13:02:50 -0400
Subject: [PATCH] Revert "Adds e2e tables test (#276)" (#292)
This reverts commit 30353c26f319c71643347cc48c05194090527e3e.
---
.github/workflows/ci.yml | 5 --
src/Explorer/Panes/AddCollectionPane.html | 2 +-
test/cassandra/container.spec.ts | 4 +-
test/mongo/container.spec.ts | 4 +-
test/sql/container.spec.ts | 4 +-
test/tables/container.spec.ts | 71 -----------------------
test/utils/shared.ts | 2 +-
7 files changed, 5 insertions(+), 87 deletions(-)
delete mode 100644 test/tables/container.spec.ts
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 53a39150a..78a043e29 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -150,11 +150,6 @@ jobs:
PORTAL_RUNNER_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_SQL }}
MONGO_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_MONGO }}
CASSANDRA_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_CASSANDRA }}
- TABLES_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_TABLE }}
- - uses: actions/upload-artifact@v2
- with:
- name: screenshots
- path: failed-*
nuget:
name: Publish Nuget
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
diff --git a/src/Explorer/Panes/AddCollectionPane.html b/src/Explorer/Panes/AddCollectionPane.html
index c41e06440..94d704046 100644
--- a/src/Explorer/Panes/AddCollectionPane.html
+++ b/src/Explorer/Panes/AddCollectionPane.html
@@ -390,7 +390,7 @@
range of values and is likely to have evenly distributed access patterns.
- {
// click delete
await frame.click('input[data-test="deleteDatabase"]');
await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
- await frame.waitFor(LOADING_STATE_DELAY);
- await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
await expect(page).not.toMatchElement(`div[data-test="${keyspaceId}"]`);
} catch (error) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const testName = (expect as any).getState().currentTestName;
- await page.screenshot({ path: `failed-${testName}.jpg` });
+ await page.screenshot({ path: `Test Failed ${testName}.png` });
throw error;
}
});
diff --git a/test/mongo/container.spec.ts b/test/mongo/container.spec.ts
index 12d77e2d7..54febbcf1 100644
--- a/test/mongo/container.spec.ts
+++ b/test/mongo/container.spec.ts
@@ -101,13 +101,11 @@ describe("Collection Add and Delete Mongo spec", () => {
// click delete
await frame.click('input[data-test="deleteDatabase"]');
await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
- await frame.waitFor(LOADING_STATE_DELAY);
- await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
await expect(page).not.toMatchElement(`div[data-test="${dbId}"]`);
} catch (error) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const testName = (expect as any).getState().currentTestName;
- await page.screenshot({ path: `failed-${testName}.jpg` });
+ await page.screenshot({ path: `Test Failed ${testName}.png` });
throw error;
}
});
diff --git a/test/sql/container.spec.ts b/test/sql/container.spec.ts
index 7d5342ca6..6b801c817 100644
--- a/test/sql/container.spec.ts
+++ b/test/sql/container.spec.ts
@@ -100,13 +100,11 @@ describe("Collection Add and Delete SQL spec", () => {
// click delete
await frame.click('input[data-test="deleteDatabase"]');
await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
- await frame.waitFor(LOADING_STATE_DELAY);
- await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
await expect(page).not.toMatchElement(`div[data-test="${dbId}"]`);
} catch (error) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const testName = (expect as any).getState().currentTestName;
- await page.screenshot({ path: `failed-${testName}.jpg` });
+ await page.screenshot({ path: `Test Failed ${testName}.jpg` });
throw error;
}
});
diff --git a/test/tables/container.spec.ts b/test/tables/container.spec.ts
deleted file mode 100644
index eb9de8e96..000000000
--- a/test/tables/container.spec.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import "expect-puppeteer";
-import { generateUniqueName, login } from "../utils/shared";
-
-jest.setTimeout(300000);
-const LOADING_STATE_DELAY = 2500;
-const RENDER_DELAY = 1000;
-
-describe("Collection Add and Delete Tables spec", () => {
- it("creates a collection", async () => {
- try {
- const tableId = generateUniqueName("TestTable");
- const frame = await login(process.env.TABLES_CONNECTION_STRING);
-
- // create new collection
- await frame.waitFor('button[data-test="New Table"]', { visible: true });
- await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
- await frame.click('button[data-test="New Table"]');
-
- // type database id
- await frame.waitFor('input[data-test="addCollection-newDatabaseId"]');
- const dbInput = await frame.$('input[data-test="addCollection-newDatabaseId"]');
- await dbInput.press("Backspace");
- await dbInput.type(tableId);
-
- // click submit
- await frame.waitFor("#submitBtnAddCollection");
- await frame.click("#submitBtnAddCollection");
-
- // validate created
- // open database menu
- await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
-
- await frame.waitFor(`div[data-test="TablesDB"]`), { visible: true };
- await frame.waitFor(LOADING_STATE_DELAY);
- await frame.waitFor(`div[data-test="TablesDB"]`), { visible: true };
- await frame.waitFor(LOADING_STATE_DELAY);
- const button = await frame.$(`div[data-test="TablesDB"]`);
- await button.focus();
- await button.asElement().click();
- await frame.waitFor(`div[data-test="${tableId}"]`, { visible: true });
-
- // delete container
-
- // click context menu for container
- await frame.waitFor(`div[data-test="${tableId}"] > div > button`, { visible: true });
- await frame.click(`div[data-test="${tableId}"] > div > button`);
-
- // click delete container
- await frame.waitFor(RENDER_DELAY);
- await frame.waitFor('span[class="treeComponentMenuItemLabel deleteCollectionMenuItemLabel"]');
- await frame.click('span[class="treeComponentMenuItemLabel deleteCollectionMenuItemLabel"]');
-
- // confirm delete container
- await frame.waitFor('input[data-test="confirmCollectionId"]', { visible: true });
- await frame.type('input[data-test="confirmCollectionId"]', tableId);
-
- // click delete
- await frame.waitFor('input[data-test="deleteCollection"]', { visible: true });
- await frame.click('input[data-test="deleteCollection"]');
- await frame.waitFor(LOADING_STATE_DELAY);
- await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
-
- await expect(page).not.toMatchElement(`div[data-test="${tableId}"]`);
- } catch (error) {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const testName = (expect as any).getState().currentTestName;
- await page.screenshot({ path: `failed-${testName}.jpg` });
- throw error;
- }
- });
-});
diff --git a/test/utils/shared.ts b/test/utils/shared.ts
index 3960a936d..458899700 100644
--- a/test/utils/shared.ts
+++ b/test/utils/shared.ts
@@ -3,7 +3,7 @@ import { Frame } from "puppeteer";
export async function login(connectionString: string): Promise {
const prodUrl = "https://localhost:1234/hostedExplorer.html";
- page.goto(prodUrl, { waitUntil: "networkidle2" });
+ page.goto(prodUrl);
// log in with connection string
const handle = await page.waitForSelector("iframe");