Commit 96532791 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch '267004-ml-update-project-page-object-matchers' into 'master'

Update tests to use page object predicate methods

See merge request gitlab-org/gitlab!44959
parents 81c3e33c a31bff2b
...@@ -37,8 +37,10 @@ module QA ...@@ -37,8 +37,10 @@ module QA
project.wait_for_push_new_branch project.wait_for_push_new_branch
# Check that the push worked # Check that the push worked
expect(page).to have_content(file_name) Page::Project::Show.perform do |project_page|
expect(page).to have_content(file_content) expect(project_page).to have_file(file_name)
expect(project_page).to have_readme_content(file_content)
end
# And check that the correct Git protocol was used # And check that the correct Git protocol was used
expect(git_protocol_reported).to eq(git_protocol) expect(git_protocol_reported).to eq(git_protocol)
......
...@@ -37,8 +37,10 @@ module QA ...@@ -37,8 +37,10 @@ module QA
# Check that the target project has the commit from the source # Check that the target project has the commit from the source
target_project.visit! target_project.visit!
expect(page).to have_content('README.md') Page::Project::Show.perform do |project_page|
expect(page).to have_content('The rendered file could not be displayed because it is stored in LFS') expect(project_page).to have_file('README.md')
expect(project_page).to have_readme_content('The rendered file could not be displayed because it is stored in LFS')
end
end end
end end
end end
......
...@@ -36,8 +36,10 @@ module QA ...@@ -36,8 +36,10 @@ module QA
project.visit! project.visit!
expect(page).to have_content('README.md') Page::Project::Show.perform do |project_page|
expect(page).to have_content("This is a test project named #{project.name}") expect(project_page).to have_file('README.md')
expect(project_page).to have_readme_content("This is a test project named #{project.name}")
end
end end
end end
end end
......
...@@ -35,9 +35,12 @@ module QA ...@@ -35,9 +35,12 @@ module QA
# Check that the target project has the commit from the source # Check that the target project has the commit from the source
target_project.visit! target_project.visit!
expect(page).to have_content("README.md")
expect(page).to have_content("This is a pull mirroring test project") Page::Project::Show.perform do |project|
expect(page).to have_content("Mirrored from #{masked_url(source_project_uri)}") expect(project).to have_file('README.md')
expect(project).to have_readme_content('This is a pull mirroring test project')
expect(project).to have_text("Mirrored from #{masked_url(source_project_uri)}")
end
end end
def masked_url(url) def masked_url(url)
......
...@@ -58,9 +58,11 @@ module QA ...@@ -58,9 +58,11 @@ module QA
# Check that the target project has the commit from the source # Check that the target project has the commit from the source
target_project.visit! target_project.visit!
expect(page).to have_content('README.md') Page::Project::Show.perform do |project|
expect(page).to have_content('This is a pull mirroring test project') expect(project).to have_file('README.md')
expect(page).to have_content("Mirrored from #{masked_url(source_project_uri)}") expect(project).to have_readme_content('This is a pull mirroring test project')
expect(project).to have_text("Mirrored from #{masked_url(source_project_uri)}")
end
end end
def masked_url(url) def masked_url(url)
......
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