[QA] Fix the 'Commit data' QA test

We now visit the project/wiki page after a push since that's the logical
page where we should be after a push.

Also, we now properly set the `@project` variable because the
`web_url` of a Push resource isn't necessarily it's project/wiki page
(if the project/wiki are created via the API for instance, `current_url`
would be the current page, not the project/wiki page).

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2018-12-13 15:13:33 +01:00
parent 81ddb69255
commit 98e6bd2122
No known key found for this signature in database
GPG key ID: 98DFFD1C0C62B70B
3 changed files with 12 additions and 2 deletions

View file

@ -26,6 +26,11 @@ module QA
def repository_ssh_uri
@repository_ssh_uri ||= project.repository_ssh_location.uri
end
def fabricate!
super
project.visit!
end
end
end
end

View file

@ -30,6 +30,11 @@ module QA
end
end
end
def fabricate!
super
wiki.visit!
end
end
end
end

View file

@ -7,17 +7,17 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
@project = Resource::Repository::ProjectPush.fabricate! do |push|
project_push = Resource::Repository::ProjectPush.fabricate! do |push|
push.file_name = 'README.md'
push.file_content = '# This is a test project'
push.commit_message = 'Add README.md'
end
@project = project_push.project
# first file added has no parent commit, thus no diff data
# add second file to repo to enable diff from initial commit
@commit_message = 'Add second file'
@project.visit!
Page::Project::Show.perform(&:create_new_file!)
Page::File::Form.perform do |f|
f.add_name('second')