Created
November 20, 2019 20:09
-
-
Save patricksevat/9729a3026ba5151669fa6459f8cf54a5 to your computer and use it in GitHub Desktop.
base class for 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/base/component-object-base.ts | |
export abstract class ComponentObjectBase { | |
componentName: string; | |
element: string; | |
elementToRender: string; | |
render = async () => { | |
if (!this.element || !this.elementToRender) { | |
throw new Error('please define an element and elementToRender to check if the feature was rendered'); | |
} | |
const errorMessage = `${this.componentName} did not render`; | |
const lastRenderedElement = await $(`${this.element} ${this.elementToRender}`); | |
await lastRenderedElement.waitForExist(20000, false, errorMessage); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment