add all four tests, and skip the edge test

This commit is contained in:
Greg Gauthier 2020-10-14 23:24:01 +01:00
parent c06e5ab66d
commit da1f39f5f7
5 changed files with 35 additions and 8 deletions

View File

@ -1,9 +1,10 @@
[behave]
default_format = pretty
show_skipped = false
show_skipped = true
show_timings = true
stdout_capture = yes
logging-level = ERROR
default_tags = ~@skip
[behave.userdata]
browser = chrome

View File

@ -8,3 +8,15 @@ Feature: Browser Demo
Given I have a firefox driver
When I navigate to test.io
Then The page is displayed
@skip
Scenario: Load test.io web page with edge
Given I have an edge driver
When I navigate to test.io
Then The page is displayed
Scenario: Load test.io web page with safari
Given I have a safari driver
When I navigate to test.io
Then The page is displayed

View File

@ -1,7 +1,5 @@
def before_all(context):
# -- SET LOG LEVEL: behave --logging-level=ERROR ...
# on behave command-line or in "behave.ini".
context.config.setup_logging()
# -- ALTERNATIVE: Setup logging with a configuration file.
# context.config.setup_logging(configfile="behave_logging.ini")

View File

@ -13,6 +13,16 @@ def step_impl(context):
context.driver = BrowserDriver.get("chrome")
@given(u'I have an edge driver')
def step_impl(context):
context.driver = BrowserDriver.get("edge")
@given(u'I have a safari driver')
def step_impl(context):
context.driver = BrowserDriver.get("safari")
@when('I navigate to test.io')
def step_impl(context):
context.driver.get("https://test.io")

View File

@ -1,10 +1,10 @@
from browserdriver import BrowserDriver
import pytest
def test_firefox_browser(headless):
bd = BrowserDriver().get("firefox", headless=headless)
bd.get('https://test.io')
print(bd.current_url, bd.title)
assert "QA Testing as a Service | test IO" == bd.title
bd.quit()
@ -12,14 +12,20 @@ def test_firefox_browser(headless):
def test_chrome_browser(headless):
bd = BrowserDriver().get("chrome", headless=headless)
bd.get('https://test.io')
print(bd.current_url, bd.title)
assert "QA Testing as a Service | test IO" == bd.title
bd.quit()
def test_safari_browser(headless):
bd = BrowserDriver().get("safari", headless=False)
bd.get('https://test.io')
assert "QA Testing as a Service | test IO" == bd.title
bd.quit()
@pytest.mark.skip(reason="inconsistent implementations across platforms")
def test_edge_browser(headless):
bd = BrowserDriver().get("edge", headless=headless)
bd.get('https://test.io')
print(bd.current_url, bd.title)
assert "QA Testing as a Service | test IO" == bd.title
bd.quit()