UNPKG

codeceptjs-cucumber

Version:
30 lines (24 loc) 622 B
const { I } = inject(); class SearchPage { constructor() { // page locators this.locators = { resultLink: 'li.repo-list-item>div>h3>a', description: 'p.col-12.col-md-9', licenseInfo: 'p.f6.text-gray' }; } async grabHrefForResult() { return await I.grabAttributeFrom( I.grabCss(this.locators.resultLink), 'href' ); } async grabDescription() { return await I.grabTextFrom(I.grabCss(this.locators.description)); } async grabLicenseInfo() { return await I.grabTextFrom(I.grabCss(this.locators.licenseInfo)); } } module.exports = new SearchPage();