move browser initialisation to Before

approved
(Bruce Becker) #1

move browser initialisation to Before

From c6e8ee7f37d0a6302addebd5554fd0e924dfd1cc Mon Sep 17 00:00:00 2001
From: Bruce Becker <brucellino@gmail.com>
Date: Sun, 21 Oct 2018 11:18:49 +0200
Subject: [PATCH] move browser initialisation to Before


diff --git a/tests/cucumber/features/step_definitions/stepdefs.rb b/tests/cucumber/features/step_definitions/stepdefs.rb
index 894195b..e4ddfe1 100644
--- a/tests/cucumber/features/step_definitions/stepdefs.rb
+++ b/tests/cucumber/features/step_definitions/stepdefs.rb
@@ -10,10 +10,10 @@ Given('I am a test user') do
   expect(@username).to be
   @password = ENV['USER_PASSWORD']
   expect(@password).to be
+  @browser = Watir::Browser.new :firefox
 end
 
 Given('I am on the main page') do
-  @browser = Watir::Browser.new :firefox
   @browser.goto 'https://community.egi.eu'
   # load_secs = @browser.performance.summary[:response_time] / 1000
   # expect(load_secs).to < 300

GitHub