diff options
Diffstat (limited to 'qa/qa/factory/resource/fork.rb')
-rw-r--r-- | qa/qa/factory/resource/fork.rb | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/qa/qa/factory/resource/fork.rb b/qa/qa/factory/resource/fork.rb index 83dd4000f0a..0fac4377040 100644 --- a/qa/qa/factory/resource/fork.rb +++ b/qa/qa/factory/resource/fork.rb @@ -2,17 +2,19 @@ module QA module Factory module Resource class Fork < Factory::Base - dependency Factory::Repository::ProjectPush, as: :push + attribute :push do + Factory::Repository::ProjectPush.fabricate! + end - dependency Factory::Resource::User, as: :user do |user| - if Runtime::Env.forker? - user.username = Runtime::Env.forker_username - user.password = Runtime::Env.forker_password + attribute :user do + Factory::Resource::User.fabricate! do |resource| + if Runtime::Env.forker? + resource.username = Runtime::Env.forker_username + resource.password = Runtime::Env.forker_password + end end end - product(:user) { |factory| factory.user } - def visit_project_with_retry # The user intermittently fails to stay signed in after visiting the # project page. The new user is registered and then signs in and a @@ -48,15 +50,20 @@ module QA end def fabricate! + push + user + visit_project_with_retry - Page::Project::Show.act { fork_project } + Page::Project::Show.perform(&:fork_project) Page::Project::Fork::New.perform do |fork_new| fork_new.choose_namespace(user.name) end - Page::Layout::Banner.act { has_notice?('The project was successfully forked.') } + Page::Layout::Banner.perform do |page| + page.has_notice?('The project was successfully forked.') + end end end end |