Skip to content

Commit

Permalink
Fix browser tests (#1262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Martinez Gotor authored Oct 30, 2019
1 parent 16830b7 commit a1a8eee
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion integration/jest-puppeteer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { headless } = require("./args");
module.exports = {
launch: {
headless,
args: ["--no-sandbox"]
args: ["--no-sandbox", "--window-size=1200,780"]
},
browserContext: "incognito"
};
6 changes: 6 additions & 0 deletions integration/jest.environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ class ScreenshotOnFailureEnvironment extends PuppeteerEnvironment {
await this.generateScreenshotsFolder();
await this.waitOnService();
await super.setup();
await this.global.page.setViewport({
width: 1200,
height: 780,
deviceScaleFactor: 1
});
await this.global.page.setDefaultTimeout(8000);
}

async teardown() {
Expand Down
4 changes: 3 additions & 1 deletion integration/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require("expect-puppeteer");
const { endpoint } = require("./args");
const { setDefaultOptions } = require("expect-puppeteer");

setDefaultOptions({ timeout: 4000 });

// endpoint argument is mandatory
if (endpoint == null || endpoint == "") {
Expand Down
1 change: 0 additions & 1 deletion integration/use-cases/create-registry.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
jest.setTimeout(120000);

test("Deploys an application with the values by default", async () => {
page.setDefaultTimeout(4000);
await page.goto(getUrl("/#/login"));

await expect(page).toFillForm("form", {
Expand Down
1 change: 0 additions & 1 deletion integration/use-cases/default-deployment.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
jest.setTimeout(120000);

test("Deploys an application with the values by default", async () => {
page.setDefaultTimeout(4000);
await page.goto(getUrl("/#/login"));

await expect(page).toFillForm("form", {
Expand Down
3 changes: 0 additions & 3 deletions integration/use-cases/missing-permissions.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
jest.setTimeout(120000);

test("Fails to deploy an application due to missing permissions", async () => {
page.setDefaultTimeout(4000);
await page.goto(getUrl("/#/login"));

await expect(page).toFillForm("form", {
token: process.env.VIEW_TOKEN
});

await page.screenshot({ path: "example.png" });

await expect(page).toClick("button", { text: "Login" });

await expect(page).toClick("a", { text: "Catalog" });
Expand Down
3 changes: 0 additions & 3 deletions script/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ for dep in ${deployments[@]}; do
echo "Deployment ${dep} ready"
done

# Wait for DNS to be ready
k8s_wait_for_deployment kube-system coredns

# Wait for Kubeapps Jobs
k8s_wait_for_job_completed kubeapps apprepositories.kubeapps.com/repo-name=stable
echo "Job apprepositories.kubeapps.com/repo-name=stable ready"
Expand Down

0 comments on commit a1a8eee

Please sign in to comment.