Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add shirt and cart page. Scenario that selects shirt and check exista… #6

Merged
merged 1 commit into from Dec 29, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,6 @@
Feature: Shop shirt
I buy a shirt using shirt name
Scenario: Buy with name
Given I visit home page
When I select Dark Thug Blue-Navy T-Shirt
Then cart has Dark Thug Blue-Navy T-Shirt
@@ -0,0 +1,5 @@
Then /^cart has Dark Thug Blue-Navy T-Shirt$/ do
on CartPage do |page|
expect(page.item_name).to eq "Dark Thug Blue-Navy T-Shirt"
end
end
@@ -0,0 +1,6 @@
When /^I select Dark Thug Blue-Navy T-Shirt$/ do
on ShirtPage do |page|
page.add_to_cart_element.click
sleep 1
end
end
@@ -0,0 +1,7 @@
class CartPage
include PageObject

page_url "<%=params[:base_url]%>"

p(:item_name, :xpath => '//*[@id="root"]/div/div[2]/div[2]/div/div[3]/p[1]')
end
@@ -0,0 +1,7 @@
class ShirtPage
include PageObject

page_url "<%=params[:base_url]%>"

div(:add_to_cart, :xpath => '//*[@id="root"]/main/div[2]/div[3]/div[4]')
end
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.