Skip to content

Commit

Permalink
fix(selenium): fix eti after new browser
Browse files Browse the repository at this point in the history
  • Loading branch information
ovsyanik-ka committed Jun 23, 2022
1 parent b7bdf34 commit e4685d5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
describe 'Создание товара' do
context 'когда товар без рубрики' do
before(:all) do
@name = Faker::Number.leading_zero_number(digits: 5)
@name = Faker::Number.leading_zero_number(digits: 5).to_s
@cs_eti_page.add_product
@cs_eti_page.set_name(@name)
@cs_eti_page.wait_saving
Expand All @@ -35,7 +35,7 @@

context 'когда товар с рубрикой' do
before(:all) do
@name = Faker::Number.number(digits: 5)
@name = Faker::Number.number(digits: 5).to_s
@cs_eti_page.add_product
@cs_eti_page.set_name(@name)
@cs_eti_page.wait_saving
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
describe 'Добавление групп' do
context 'когда привязываем группу к товару' do
before(:all) do
@product = {name: Faker::Number.number(digits: 5)}
@product = {name: Faker::Number.number(digits: 5).to_s}
@cs_eti_page.create_and_set_product_fields(@product)
@cs_eti_page.set_group(CONFIG['product_creation']['group'])
@cs_eti_page.wait_saving
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

describe 'Установка цен', feature: 'company_site/eti/product_price_spec: Установка цен' do
before do
@name = Faker::Number.number(digits: 5)
@name = Faker::Number.number(digits: 5).to_s
@cs_eti_page.add_product
@cs_eti_page.set_name(@name)
end
Expand Down
22 changes: 4 additions & 18 deletions lib/pages/company_site/eti_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,14 @@ def set_discount_price(options = {})
end

def set_price(text)
browser
.action
.move_to(price_cell_element.element)
.click
.send_keys(price_text_area_element.element, text)
.perform

price_cell_element.click
self.price_text_area = text
try_to(:save_price)
wait_saving
end

def set_wholesale_price(options = {})
browser
.action
.move_to(wholesale_price_cell_element.element)
.click
.perform

wholesale_price_cell_element.click
self.wholesale_price = options.fetch(:wholesale_price, '')
self.wholesale_number = options.fetch(:wholesale_number, '')

Expand All @@ -180,11 +170,7 @@ def set_wholesale_price(options = {})
end

def set_rubric(text)
browser
.action
.move_to(rubric_cell_element.element)
.click
.perform
rubric_cell_element.click

self.rubric_search = text
rubric_search_submit
Expand Down

0 comments on commit e4685d5

Please sign in to comment.