-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add e2e tests for global settings label #1715
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
visualization/app/codeCharta/ui/dialog/dialog.globalSettings.e2e.ts
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,40 @@ | ||
import { goto } from "../../../puppeteer.helper" | ||
import { FileChooserPageObject } from "../fileChooser/fileChooser.po" | ||
import { DialogGlobalSettingsPageObject } from "./dialog.globalSettings.po" | ||
|
||
describe("LegendPanel", () => { | ||
let globalSettingsPageObject: DialogGlobalSettingsPageObject | ||
let fileChooser: FileChooserPageObject | ||
|
||
beforeEach(async () => { | ||
globalSettingsPageObject = new DialogGlobalSettingsPageObject() | ||
fileChooser = new FileChooserPageObject() | ||
|
||
await goto() | ||
await setupTest() | ||
}) | ||
|
||
async function setupTest() { | ||
await fileChooser.openFiles(["./app/codeCharta/ressources/sample1_with_different_edges.cc.json"]) | ||
await globalSettingsPageObject.openGlobalSettings() | ||
} | ||
|
||
describe("GlobalSettings", () => { | ||
it("Should contain the label for the map layout", async () => { | ||
const label = await globalSettingsPageObject.getMapLayoutLabel() | ||
expect(label).toEqual("Map Layout") | ||
}) | ||
it("Should contain the Display quality Layout", async () => { | ||
const label = await globalSettingsPageObject.getDisplayQualityLabel() | ||
expect(label).toEqual("Display quality") | ||
}) | ||
/* | ||
it("Should change the layout algorithm", async () => { | ||
globalSettingsPageObject.changeLayout() | ||
globalSettingsPageObject.setStreetMapAsLayout() | ||
const label = await globalSettingsPageObject.getLayout() | ||
console.log("this.is.it ", label) | ||
}) | ||
*/ | ||
}) | ||
}) |
16 changes: 16 additions & 0 deletions
16
visualization/app/codeCharta/ui/dialog/dialog.globalSettings.po.ts
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,16 @@ | ||
import { clickButtonOnPageElement } from "../../../puppeteer.helper" | ||
|
||
export class DialogGlobalSettingsPageObject { | ||
async openGlobalSettings() { | ||
await clickButtonOnPageElement("global-settings-button-component .toolbar-button") | ||
await page.waitForSelector("md-dialog.global-settings") | ||
} | ||
|
||
async getMapLayoutLabel() { | ||
return page.$eval("layout-selection-component > div > md-input-container > label", element => element["innerText"]) | ||
} | ||
|
||
async getDisplayQualityLabel() { | ||
return page.$eval("sharpness-mode-selector-component > div > md-input-container > label", element => element["innerText"]) | ||
} | ||
} |