Last active
July 6, 2018 04:08
-
-
Save jwaldrip/26684819847fc9c1ee8511ec59ec6da4 to your computer and use it in GitHub Desktop.
POC for PageOx
This file contains hidden or 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
import LoginScreen from "./login-screen-object"; | |
import BasicInfoScreen from "./basic-info-screen-object"; | |
const loginScreen = new LoginScreen(); | |
const basicInfoScreen = new BasicInfoScreen(); | |
describe("login screen", () => { | |
it("should be be deeplinkable", async () => { | |
await loginScreen.open(); | |
await expect(loginScreen.element).toBeVisible(); | |
}) | |
it("should allow a user to login", async () => { | |
await loginScreen.open(); | |
await loginScreen.fillInEmail("[email protected]"); | |
await loginScreen.fillInPassword("password"); | |
await loginScreen.tapSubmit(); | |
await expect(loginScreen).toBeVisible(); | |
}) | |
}); |
This file contains hidden or 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
import faker from "faker"; | |
import { PageObject } from "page-ox"; | |
export default class LoginScreen extends PageObject { | |
static deepLinkURI = "/auth/login"; | |
static element = element(by.id("login-screen")); | |
fillInEmail(email = faker.internet.exampleEmail()) { | |
return element(by.id("email-address-input")).typeText(email); | |
} | |
fillInPassword(password = faker.internet.password(15)) { | |
return element(by.id("password-input")).typeText(password); | |
} | |
tapSubmit() { | |
return element(by.id("email-address-input")).typeText(email); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment