-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Initial e2e tests setup (#332)
* Tests: config integration tests Add "Add trigger" test Add "Navigate to Add trigger page" test * Find the redis instance name and put into clearDatabase expression * Storybook with typescript Co-authored-by: Vladimir Sorokin <v_sorokin@kontur>
- Loading branch information
Sorokin Vladimir
and
Vladimir Sorokin
authored
Aug 20, 2020
1 parent
69bbc2c
commit 4134810
Showing
37 changed files
with
1,431 additions
and
910 deletions.
There are no files selected for viewing
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
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
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
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,23 @@ | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
launch: { | ||
headless: process.env.HEADLESS !== "false", | ||
}, | ||
browser: "chromium", | ||
server: [ | ||
{ | ||
command: `docker-compose -f ${path.join( | ||
__dirname, | ||
"src/tests/core/api/docker-compose.yml" | ||
)} up`, | ||
port: 8080, | ||
launchTimeout: 120000, | ||
}, | ||
{ | ||
command: "yarn start-with-local-api", | ||
port: 9000, | ||
launchTimeout: 60000, | ||
}, | ||
], | ||
}; |
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,13 @@ | ||
let isE2eTests = process.env["TYPE"] === "e2e"; | ||
// When running on code editor | ||
const testPathIndex = process.argv.findIndex((arg) => arg === "--runTestsByPath"); | ||
if (testPathIndex !== -1) { | ||
const testPath = process.argv[testPathIndex + 1]; | ||
isE2eTests = testPath.includes("/src/tests"); | ||
} | ||
|
||
module.exports = { | ||
// NOTE: ignore e2e tests when running jest with common config | ||
modulePathIgnorePatterns: isE2eTests ? [] : ["/src/tests"], | ||
preset: isE2eTests ? "jest-puppeteer" : undefined, | ||
}; |
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
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function delay(timeout: number): Promise<void> { | ||
return new Promise(resolve => setTimeout(resolve, timeout)); | ||
return new Promise((resolve) => setTimeout(resolve, timeout)); | ||
} |
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
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
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
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
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,23 @@ | ||
import { clearDatabase } from "./core/utils"; | ||
import { AddTriggerPage } from "./pages/AddTriggerPage"; | ||
import { TriggerViewPage } from "./pages/TriggerViewPage"; | ||
|
||
describe("Add trigger page", () => { | ||
beforeAll(async () => { | ||
await clearDatabase(); | ||
}); | ||
|
||
it(`create new trigger`, async () => { | ||
const addTriggerPage = new AddTriggerPage(page); | ||
await addTriggerPage.open(); | ||
await addTriggerPage.Name.type("trigger name"); | ||
await addTriggerPage.TargetT1.type("sumSeries(test.target.*)"); | ||
await addTriggerPage.WarnT1.type("10"); | ||
await addTriggerPage.Tags.addTag("test"); | ||
await addTriggerPage.AddTrigger.click(); | ||
|
||
const triggerViewPage = new TriggerViewPage(page); | ||
await expect(triggerViewPage.isOpen()).resolves.toEqual(true); | ||
await expect(triggerViewPage.Name).resolves.toEqual("trigger name"); | ||
}, 30000); | ||
}); |
Oops, something went wrong.