Skip to content

Commit

Permalink
Update InventoryItemPage.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
OlehBabenkoo committed Jun 5, 2023
1 parent 415aaea commit b357352
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cypress/page-object/pages/InventoryItemPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export default class InventoryItemPage extends BasePage {
return cy.get(`${this.inventoryContainer} [class="inventory_details_price"`);
}

private get inventoryBtn(): Cypress.Chainable {
return cy.get(`${this.inventoryContainer} [class="btn_primary btn_inventory"`);
}

private checkItemTitle(): this {
this.inventoryItemTitle.should('be.visible');
return this;
Expand All @@ -42,7 +46,7 @@ export default class InventoryItemPage extends BasePage {

}
public addProductToCart(): this {
this.inventoryItem.contains('button', 'ADD TO CART').click();
this.inventoryBtn.contains('button', 'ADD TO CART').click();
return this;
}
public removeProductFromCard(): this {
Expand Down

0 comments on commit b357352

Please sign in to comment.