-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
788 additions
and
843 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
*/ | ||
|
||
export * from "./sleep.helper" | ||
export * from "./add-device.helper" |
61 changes: 61 additions & 0 deletions
61
apps/mudita-center-e2e/src/page-objects/about-kompakt.page.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,61 @@ | ||
/** | ||
* Copyright (c) Mudita sp. z o.o. All rights reserved. | ||
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md | ||
*/ | ||
|
||
import Page from "./page" | ||
|
||
class AboutKompaktPage extends Page { | ||
public get aboutHeader() { | ||
return $("h3*=About your device") | ||
} | ||
|
||
public get aboutSubtitle() { | ||
return $("p*=Device details") | ||
} | ||
|
||
public get backToOverviewIcon() { | ||
return $('[data-testid="icon-ArrowLongLeft"]') | ||
} | ||
|
||
public get backToOverviewLabel() { | ||
return $('[data-testid="location"]') | ||
} | ||
|
||
public get serialNumberLabel() { | ||
return $('[data-testid="about-data-box-label-serial-number"]') | ||
} | ||
|
||
public get serialNumberValue() { | ||
return $('[data-testid="about-data-box-value-serial-number"]') | ||
} | ||
|
||
public get imei1Label() { | ||
return $('[data-testid="about-data-box-label-imei-(sim-slot-1)"]') | ||
} | ||
|
||
public get imei1Value() { | ||
return $('[data-testid="about-data-box-value-imei-(sim-slot-1)"]') | ||
} | ||
|
||
public get imei2Label() { | ||
return $('[data-testid="about-data-box-label-imei-(sim-slot-2)"]') | ||
} | ||
|
||
public get imei2Value() { | ||
return $('[data-testid="about-data-box-value-imei-(sim-slot-2)"]') | ||
} | ||
|
||
public get sarLabel() { | ||
return $('[data-testid="about-data-box-label-sar"]') | ||
} | ||
|
||
public get sarButton() { | ||
return $('[data-testid="button-text_sarmodal-button"]') | ||
} | ||
|
||
public get sarHeader() { | ||
return $("h3*=SAR") | ||
} | ||
} | ||
export default new AboutKompaktPage() |
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,34 @@ | ||
/** | ||
* Copyright (c) Mudita sp. z o.o. All rights reserved. | ||
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md | ||
*/ | ||
|
||
import Page from "./page" | ||
|
||
export class Menu extends Page { | ||
public get newsLink() { | ||
return $(`//a[@href="#/news"]`) | ||
} | ||
|
||
public get kompaktLabel() { | ||
return $('[data-testid="Kompakt"]') | ||
} | ||
|
||
public get overviewLink() { | ||
return $(`//a[@href="#/generic/mc-overview"]`) | ||
} | ||
|
||
public get muditaCenterLabel() { | ||
return $('[data-testid="component.menuHeaderDesktopApp"]') | ||
} | ||
|
||
public get settingsLink() { | ||
return $(`//a[@href="#/settings"]`) | ||
} | ||
|
||
public get helpLink() { | ||
return $(`//a[@href="#/help"]`) | ||
} | ||
} | ||
|
||
export default new Menu() |
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,17 @@ | ||
/** | ||
* Copyright (c) Mudita sp. z o.o. All rights reserved. | ||
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md | ||
*/ | ||
|
||
import Page from "./page" | ||
|
||
class AboutKompaktPage extends Page { | ||
public get sarHeader() { | ||
return $("h3*=SAR") | ||
} | ||
|
||
public get modalCloseButton() { | ||
return $('[data-testid="icon-close"]') | ||
} | ||
} | ||
export default new AboutKompaktPage() |
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
29 changes: 29 additions & 0 deletions
29
apps/mudita-center-e2e/src/page-objects/select-device.page.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,29 @@ | ||
/** | ||
* Copyright (c) Mudita sp. z o.o. All rights reserved. | ||
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md | ||
*/ | ||
|
||
import { index } from "@orama/orama/dist/components" | ||
import Page from "./page" | ||
|
||
class SelectDevicePage extends Page { | ||
public get devicesList() { | ||
return $("[data-testid='devices-list']") | ||
} | ||
public get availableDevices() { | ||
return $$('[data-testid="available-device"]') | ||
} | ||
public get selectDeviceSerialNumber() { | ||
return $$('[data-testid="available-device-serial-number"]') | ||
} | ||
public get selectDeviceName() { | ||
return $$('[data-testid="available-device-name"]') | ||
} | ||
public get selectADeviceToContinueTitle() { | ||
return $("h1*=Select a device to continue") | ||
} | ||
public getDeviceOnSelectModal(index: number) { | ||
return $(`(//p[@data-testid="available-device-serial-number"])[${index}]`) | ||
} | ||
} | ||
export default new SelectDevicePage() |
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
128 changes: 128 additions & 0 deletions
128
apps/mudita-center-e2e/src/specs/overview/kompakt-about.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,128 @@ | ||
import { E2EMockClient } from "../../../../../libs/e2e-mock/client/src" | ||
import { overviewDataWithOneSimCard } from "../../../../../libs/e2e-mock/responses/src" | ||
import homePage from "../../page-objects/home.page" | ||
import menu from "../../page-objects/menu.page" | ||
import overviewKompaktPage from "../../page-objects/overview-kompakt.page" | ||
import aboutKompaktPage from "../../page-objects/about-kompakt.page" | ||
import modalSarPage from "../../page-objects/modal-sar.page" | ||
import { kompaktImeiRegex } from "../../consts/regex-const" | ||
|
||
describe("Checking About your Kompakt", () => { | ||
before(async () => { | ||
E2EMockClient.connect() | ||
//wait for a connection to be established | ||
await browser.waitUntil(() => { | ||
return E2EMockClient.checkConnection() | ||
}) | ||
}) | ||
|
||
it("Connect device", async () => { | ||
E2EMockClient.mockResponse({ | ||
path: "path-1", | ||
body: overviewDataWithOneSimCard, | ||
endpoint: "FEATURE_DATA", | ||
method: "GET", | ||
status: 200, | ||
}) | ||
|
||
E2EMockClient.addDevice({ | ||
path: "path-1", | ||
serialNumber: "first-serial-number", | ||
}) | ||
|
||
await browser.pause(6000) | ||
const menuOverviewLink = await menu.overviewLink | ||
await menuOverviewLink.waitForDisplayed({ timeout: 10000 }) | ||
await expect(menuOverviewLink).toBeDisplayed() | ||
}) | ||
|
||
it("Check SN", async () => { | ||
const serialNumberValue = await overviewKompaktPage.serialNumberValue | ||
await expect(serialNumberValue).toHaveText( | ||
overviewDataWithOneSimCard.summary.about.serialNumber.text | ||
) | ||
}) | ||
|
||
it("Go to ABOUT YOUR DEVICE", async () => { | ||
const aboutYourDevice = await overviewKompaktPage.aboutYourDevice | ||
await aboutYourDevice.waitForClickable() | ||
await aboutYourDevice.click() | ||
|
||
// Header | ||
const aboutHeader = await aboutKompaktPage.aboutHeader | ||
await expect(aboutHeader).toBeDisplayed() | ||
await expect(aboutHeader).toHaveText("About your device") | ||
}) | ||
|
||
it("Verify About Your Device page", async () => { | ||
// Subtitle | ||
const aboutSubtitle = await aboutKompaktPage.aboutSubtitle | ||
await expect(aboutSubtitle).toHaveText("Device details") | ||
// SN | ||
const serialNumberLabel = await aboutKompaktPage.serialNumberLabel | ||
await expect(serialNumberLabel).toHaveText("Serial number") | ||
const serialNumberValue = await aboutKompaktPage.serialNumberValue | ||
await expect(serialNumberValue).toHaveText( | ||
overviewDataWithOneSimCard.summary.about.serialNumber.text | ||
) | ||
// IMEI 1 | ||
const imei1Label = await aboutKompaktPage.imei1Label | ||
await expect(imei1Label).toHaveText("IMEI (sim slot 1)") | ||
const imei1Value = await aboutKompaktPage.imei1Value | ||
const imei1 = await imei1Value.getText() | ||
await expect(imei1Value).toHaveText(kompaktImeiRegex) | ||
// IMEI 2 | ||
const imei2Label = await aboutKompaktPage.imei2Label | ||
await expect(imei2Label).toHaveText("IMEI (sim slot 2)") | ||
const imei2Value = await aboutKompaktPage.imei2Value | ||
const imei2 = await imei2Value.getText() | ||
await expect(imei2Value).toHaveText(kompaktImeiRegex) | ||
//SAR | ||
const sarLabel = await aboutKompaktPage.sarLabel | ||
await expect(sarLabel).toHaveText("SAR") | ||
const sarButton = await aboutKompaktPage.sarButton | ||
await expect(sarButton).toHaveText("Check SAR information") | ||
await expect(sarButton).toBeClickable() | ||
}) | ||
|
||
it("Go to SAR information", async () => { | ||
const sarButton = await aboutKompaktPage.sarButton | ||
await sarButton.waitForClickable() | ||
await sarButton.click() | ||
const sarHeader = await aboutKompaktPage.sarHeader | ||
await expect(sarHeader).toHaveText("SAR") | ||
// TBD: SAR content + scroll | ||
}) | ||
|
||
it("Close SAR information", async () => { | ||
const modalCloseButton = await modalSarPage.modalCloseButton | ||
await expect(modalCloseButton).toBeDisplayed() | ||
await modalCloseButton.click() | ||
}) | ||
|
||
it("Go to Overview", async () => { | ||
const backToOverviewIcon = await aboutKompaktPage.backToOverviewIcon | ||
await backToOverviewIcon.isDisplayed() | ||
|
||
const backToOverviewLabel = await aboutKompaktPage.backToOverviewLabel | ||
await backToOverviewLabel.isDisplayed() | ||
backToOverviewLabel.click() | ||
|
||
const header = await overviewKompaktPage.header | ||
await header.isDisplayed() | ||
|
||
const menuOverviewLink = await menu.overviewLink | ||
await expect(menuOverviewLink).not.toBeClickable() | ||
}) | ||
|
||
it("Disconnect the device and check if Welcome screen is present", async () => { | ||
E2EMockClient.removeDevice("path-1") | ||
const homeHeader = await homePage.homeHeader | ||
await expect(homeHeader).toBeDisplayed() | ||
}) | ||
|
||
after(() => { | ||
E2EMockClient.stopServer() | ||
E2EMockClient.disconnect() | ||
}) | ||
}) |
Oops, something went wrong.