/** * Remove swag from the cart based on text or a number * * @param {number|string} needle * * @return {Promise<void>} */ removeSwag(needle) { return t.click(this.getSwagRemoveButton(needle)); }
test('Test greeting form: with name', async t => { await t // Input name .typeText(Selector('#root input[type="text"]'), 'Atreus', { replace: true }) // Click submit button .click(Selector('#root button')) .expect(Selector('#root h1').innerText).eql('hello Atreus!') })
/** * Open the about page * * @returns {Promise<void>} */ async openAboutPage() { return t.click(this.aboutButton); }
/** * Add a swag item to the cart * * @param {number|string} needle * * @returns {Promise<void>} */ addSwagToCart(needle) { return t.click(this.getSwagItemAddButton(needle)); }
test('Create 1 task and check it item', async t => { await t .typeText('input', 'task 1') .click('button') .expect(Selector('.alert').innerText).eql('task 1') })
/** * Open the cart * * @returns {Promise<void>} */ openCart() { return t.click(this.cart); }
/** * Cancel checkout * * @returns {Promise<void>} */ cancelCheckout() { return t.click(this.cancelButton); }
/** * Add the item to the cart * * @returns {Promise<void>} */ addToCart(){ return t.click(this.addButton); }
/** * Go to the checkout process * * @return {Promise<void>} */ goToCheckout() { return t.click(this.checkoutButton); }
/** * Open the inventory list page * * @returns {Promise<void>} */ async openInventoryList() { return t.click(this.inventoryListButton); }
/** * Logout * * @returns {Promise<void>} */ async logout() { return t.click(this.logoutButton); }
/** * Reset the app state * * @returns {Promise<void>} */ async restAppState() { return t.click(this.resetButton); }
/** * Finsh checkout * * @returns {Promise<void>} */ finishCheckout() { return t.click(this.finishButton); }
/** * Remove the item from the cart * * @returns {Promise<void>} */ removeFromCart(){ return t.click(this.removeButton); }
/** * Cancel checkout * * @returns {Promise<void>} */ cancelCheckout() { return t.click(this.cancelButton); }