Created
November 20, 2019 20:32
-
-
Save patricksevat/024146bc284e434ccc77ab5e661f636a to your computer and use it in GitHub Desktop.
Naive, not DRY implementation of an Component Object
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
// ./objects/features/bank-account.ts | |
export class BankAccountObject { | |
// internal id | |
componentName = 'bank-account'; | |
// this is the root element: <my-bank-account /> | |
element = 'my-bank-account'; | |
// this is a (deep) element that renders latest | |
elementToRender = '#async-fetch-bank-account-balance'; | |
render = async () => { | |
// retrieve 'my-bank-account #async-fetch-bank-account-balance' | |
const checkRenderedElement = await $(`${this.element} ${this.elementToRender}`); | |
// make sure that the element exists on the DOM within 20s | |
await checkRenderedElement.waitForExist(20000); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment