feat: Add credentials E2E test suite and page object (#4596)

* fix: Fix inferred type of X cannot be named error after pnpm update

* feat: Change page objects to expose actions and getters. Add credential creation suite
This commit is contained in:
Alex Grozav
2022-11-22 11:37:26 +02:00
committed by GitHub
parent 772ec78349
commit b5b44d1b59
23 changed files with 159 additions and 67 deletions

View File

@@ -1,15 +1,6 @@
import { IE2ETestPage, IE2ETestPageElement } from "../types";
export class BasePage implements IE2ETestPage {
elements: Record<string, IE2ETestPageElement> = {};
get(id: keyof BasePage['elements'], ...args: unknown[]): ReturnType<IE2ETestPageElement> {
const getter = this.elements[id];
if (!getter) {
throw new Error(`No element with id "${id}" found. Check your page object definition.`);
}
return getter(...args);
}
getters: Record<string, IE2ETestPageElement> = {};
actions: Record<string, (...args: any[]) => void> = {};
}