This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capybara.register_driver :chrome do |app| | |
args = ["--start-fullscreen", "--disable-infobars", "--disable-notifications"] | |
Capybara::Selenium::Driver.new(app, {:browser => :chrome, :args => args}) | |
end | |
Capybara.register_driver :chrome_headless do |app| | |
args = ["--window-size=1280,1696", "--no-sandbox", "--headless", "--disable-gpu", "--disable-infobars", "--disable-notifications"] | |
Capybara::Selenium::Driver.new(app, {:browser => :chrome, :args => args}) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: M001 - Adding new addresses | |
As a member | |
I Want to create address | |
So That I can order a product | |
@javascript @order @test_env | |
Scenario: Member should successfully add his first address | |
When I login to to system as "John Doe" | |
And I ensure that I have no address | |
And I go to new address page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
/* Shifts body so navigation bar does not overlap it. | |
Make sure to include this after the core Bootstrap CSS. */ | |
padding-top: 60px; | |
} | |
h2 { | |
font-size: 24px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capybara.register_driver :chrome_no_image do |app| | |
preferences = { | |
"profile.managed_default_content_settings.images" => 2, | |
} | |
caps = Selenium::WebDriver::Remote::Capabilities.chrome( | |
'chromeOptions' => { | |
'prefs' => preferences | |
} | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After do |scenario| | |
if scenario.failed? | |
take_screenshot(scenario) | |
end | |
end | |
def take_screenshot(scenario) | |
if RbConfig::CONFIG["host_os"] == "mingw32" | |
screenshot_path = 'C:\Users\Administrator\Documents\web-automation\features\support\media\\' + '#{scenario.__id__}.png' | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After do |scenario| | |
if scenario.failed? | |
take_screenshot(scenario) | |
end | |
end | |
def take_screenshot(scenario) | |
# set screenshot path depends on operating system | |
if RbConfig::CONFIG["host_os"] == "mingw32" | |
screenshot_path = 'C:\Users\Administrator\Documents\web-automation\features\support\media\\' + '#{scenario.__id__}.png' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 15 | |
chr = ' +' | |
for i in xrange(n): | |
line = '' | |
if i == 0 or i == n - 1 or i == (n / 2): | |
line = n * chr | |
else: | |
if i < n / 2: | |
middle = i * 2 - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 15 | |
chr = ' +' | |
for i in xrange(n): | |
line = '' | |
if i == 0 or i == n - 1 or i == (n / 2): | |
line = n * chr | |
else: | |
if i < n / 2: | |
middle = i * 2 - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DesiredCapabilities capabilities = new DesiredCapabilities(); | |
capabilities.setCapability("deviceName", "MOTO G 2"); | |
capabilities.setCapability("platformName", "Android"); | |
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Chrome"); | |
capabilities.setCapability("platformVersion", "5.0.2"); | |
capabilities.setCapability("appPackage", "com.android.chrome"); | |
capabilities.setCapability("appActivity","com.google.android.apps.chrome.ChromeTabbedActivity"); | |
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re, sys | |
import os | |
MIN_RESPONSE_TIME = int(os.environ['min_response_time']) | |
MAX_RESPONSE_TIME = int(os.environ['max_response_time']) | |
AVG_RESPONSE_TIME = int(os.environ['avg_response_time']) | |
print("\n---- Test Parameters -----\n") | |
print("MIN_RESPONSE_TIME: %d" % MIN_RESPONSE_TIME) | |
print("MAX_RESPONSE_TIME: %d" % MAX_RESPONSE_TIME) |