Skip to content

Commit

Permalink
fix(selenium): fix after release april
Browse files Browse the repository at this point in the history
  • Loading branch information
ovsyanik-ka committed Apr 30, 2021
1 parent 70b8cc6 commit 8b7a60e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
context 'когда копируем товар' do
before(:all) do
@product = {
name: Faker::Number.number(digits: 5),
name: Faker::Number.leading_zero_number(digits: 5),
rubric: CONFIG['eti']['rubric'],
exists: CONFIG['eti']['exists']['in stock'],
short_description: CONFIG['product_creation']['short_description']['valid'],
Expand Down Expand Up @@ -93,7 +93,6 @@
expect(@cs_eti_page.product_rows_elements.length).to eq 2
expect(@cs_eti_page.product_rows_elements[1].text).to eq @first_product
end

end
end
end
24 changes: 12 additions & 12 deletions lib/apress/selenium_eti/spec/company_site/minieti_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
context 'когда заполняем имя' do
before(:all) do
@cs_eti_page.add_product
@name = Faker::Number.number(5)
@name = Faker::Number.leading_zero_number(5)
@cs_eti_page.set_name(@name)
end

Expand Down Expand Up @@ -46,15 +46,15 @@
context 'когда заполняем цену' do
before(:all) do
@cs_eti_page.add_product
@cs_eti_page.set_name(Faker::Number.number(digits: 5))
@cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5))
@thermometer_value = @cs_eti_page.thermometer_value
@price = Faker::Number.number(digits: 3)

@cs_eti_page.set_price(@price)
@cs_eti_page.set_price(@price.to_s)
end

it 'введенная цена отображается' do
expect(@cs_eti_page.price_value).to include @price
expect(@cs_eti_page.price_value).to include @price.to_s
end

it 'увеличивается градус на термометре' do
Expand All @@ -65,10 +65,10 @@
context 'когда заполняем цену от и до' do
before(:all) do
@cs_eti_page.add_product
@cs_eti_page.set_name(Faker::Number.number(digits: 5))
@cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5))

@thermometer_value = @cs_eti_page.thermometer_value
@price_from_to = {from: Faker::Number.number(digits: 2), to: Faker::Number.number(digits: 3)}
@price_from_to = {from: Faker::Number.number(digits: 2).to_s, to: Faker::Number.number(digits: 3).to_s}

@cs_eti_page.set_price_from_to(@price_from_to)
end
Expand All @@ -81,10 +81,10 @@
context 'когда заполняем цену со скидкой' do
before(:all) do
@cs_eti_page.add_product
@cs_eti_page.set_name(Faker::Number.number(digits: 5))
@cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5))

@thermometer_value = @cs_eti_page.thermometer_value
@discount_price = {previous: Faker::Number.number(digits: 3), discount: Faker::Number.number(digits: 2)}
@discount_price = {previous: Faker::Number.number(digits: 3).to_s, discount: Faker::Number.number(digits: 2).to_s}

@cs_eti_page.set_discount_price(@discount_price)
end
Expand All @@ -99,7 +99,7 @@
context 'когда заполняем наличие' do
before do
@cs_eti_page.add_product
@cs_eti_page.set_name(Faker::Number.number(digits: 5))
@cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5))
@cs_eti_page.set_exists(CONFIG['eti']['exists']['in stock'])
end

Expand All @@ -111,7 +111,7 @@
context 'когда заполняем рубрику' do
before(:all) do
@cs_eti_page.add_product
@cs_eti_page.set_name(Faker::Number.number(digits: 5))
@cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5))
@rubric = @cs_eti_page.rubric_cell
@cs_eti_page.set_rubric(CONFIG['eti']['rubric'])
end
Expand Down Expand Up @@ -165,7 +165,7 @@
describe 'Удаление товара' do
before do
@cs_eti_page.add_product
@name = Faker::Number.number(digits: 5)
@name = Faker::Number.leading_zero_number(digits: 5)
@cs_eti_page.set_name(@name)
@cs_mini_eti_page.delete_first_product
end
Expand All @@ -180,7 +180,7 @@
@cs_eti_page.add_product
@name = Faker::Games::Pokemon.name
@cs_eti_page.set_name(@name)
@cs_eti_page.set_price(@price = Faker::Number.number(digits: 5))
@cs_eti_page.set_price(@price = Faker::Number.number(digits: 5).to_s)
@cs_eti_page.wait_saving

@cs_mini_eti_page.copy_product
Expand Down

0 comments on commit 8b7a60e

Please sign in to comment.