Commit e90bf94e authored by Gabriel Mazetto's avatar Gabriel Mazetto

Fix replication QA specs, extract filter_by_name

parent c2c46013
...@@ -5,12 +5,16 @@ module QA ...@@ -5,12 +5,16 @@ module QA
view 'app/views/dashboard/projects/index.html.haml' view 'app/views/dashboard/projects/index.html.haml'
def go_to_project(name) def go_to_project(name)
filter_by_name(name)
find_link(text: name).click
end
def filter_by_name(name)
page.within('form#project-filter-form') do page.within('form#project-filter-form') do
fill_in :name, with: name fill_in :name, with: name
page.find_field('name').native.send_key(:enter) page.find_field('name').native.send_key(:enter)
end end
find_link(text: name).click
end end
end end
end end
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
page.within(selector) do page.within(selector) do
find_button('Expand').click find_button('Expand').click
yield yield if block_given?
end end
end end
end end
......
...@@ -38,7 +38,7 @@ module QA ...@@ -38,7 +38,7 @@ module QA
expect(page).to have_content 'You are on a secondary (read-only) Geo node' expect(page).to have_content 'You are on a secondary (read-only) Geo node'
Page::Main::Menu.perform do |menu| Page::Menu::Main.perform do |menu|
menu.go_to_projects menu.go_to_projects
expect(page).to have_content(geo_project_name) expect(page).to have_content(geo_project_name)
...@@ -57,7 +57,7 @@ module QA ...@@ -57,7 +57,7 @@ module QA
# rename the project # rename the project
visit(Runtime::Browser.url_for(:geo_primary, QA::Page::Main::Home)) visit(Runtime::Browser.url_for(:geo_primary, QA::Page::Main::Home))
Page::Main::Menu.act { go_to_projects } Page::Menu::Main.act { go_to_projects }
Page::Dashboard::Projects.perform do |dashboard| Page::Dashboard::Projects.perform do |dashboard|
dashboard.go_to_project(geo_project_name) dashboard.go_to_project(geo_project_name)
...@@ -80,7 +80,7 @@ module QA ...@@ -80,7 +80,7 @@ module QA
expect(page).to have_content 'You are on a secondary (read-only) Geo node' expect(page).to have_content 'You are on a secondary (read-only) Geo node'
Page::Main::Menu.perform do |menu| Page::Menu::Main.perform do |menu|
menu.go_to_projects menu.go_to_projects
expect(page).to have_content(geo_project_newname) expect(page).to have_content(geo_project_newname)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment