Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default async (): Promise => {
// get the config that was injected into the fixture/test context by the feature
const config: Config = getCurrentConfig(t);
// eslint-disable-next-line @typescript-eslint/no-use-before-define
ensureEnvIsSetupInConfigurationFile(config);
if (config && config.env) {
await t.navigateTo(config.env.url);
}
};
async function goToRoute(route: string) {
await t.navigateTo(`/#${route}`);
}
async navigatePdfEntries (text) {
await t
.navigateTo(`${baseURL}/wp-admin/admin.php?page=${text}`)
}
}
async login(user: string, password: string) {
await t
.navigateTo(this.url)
.typeText(this.userNameInput, user)
.typeText(this.passwordInput, password)
.click(this.loginButton)
.expect(this.getLocation()).eql(config.baseUrl + '/home');
}
}
goTo(urlPath: string) {
return t.navigateTo(`${this.baseURL}${urlPath}`);
}
}