Ejemplo n.º 1
0
    def test_raises_exception_if_no_username_set(self):
        session = SauceSession()

        session.username = None

        with pytest.raises(KeyError):
            session.start()
Ejemplo n.º 2
0
    def test_update_method(self):
        session = SauceSession()

        session.start()

        session.update_test_result(True)
        session.stop()
Ejemplo n.º 3
0
    def test_raises_exception_if_no_access_key_set(self):
        session = SauceSession()

        session.access_key = None

        with pytest.raises(KeyError):
            session.start()
Ejemplo n.º 4
0
    def test_raises_exception_if_no_access_key_set(self):
        del os.environ['SAUCE_ACCESS_KEY']
        session = SauceSession()

        with pytest.raises(KeyError):
            session.start()

        os.environ['SAUCE_ACCESS_KEY'] = SAUCE_ACCESS_KEY_HOLDER
Ejemplo n.º 5
0
    def test_raises_exception_if_no_username_set(self):
        del os.environ['SAUCE_USERNAME']
        session = SauceSession()

        with pytest.raises(KeyError):
            session.start()

        os.environ['SAUCE_USERNAME'] = SAUCE_USERNAME_HOLDER
def driver(request):
    opts = SauceOptions(browserName=request.param)
    sauce = SauceSession(options=opts)
    sauce.start()

    yield sauce.driver

    sauce.stop()
Ejemplo n.º 7
0
def driver(request):
    opts = SauceOptions()
    opts.name = request.node.name
    sauce = SauceSession(options=opts)
    sauce.start()

    yield sauce.driver

    # report results
    # use the test result to send the pass/fail status to Sauce Labs
    result = not request.node.rep_call.failed

    sauce.stop(result)
Ejemplo n.º 8
0
def driver(request):
    opts = SauceOptions()
    opts.name = request.node.name
    sauce = SauceSession(options=opts)
    sauce.start()

    yield sauce.driver

    # report results
    # use the test result to send the pass/fail status to Sauce Labs
    if request.node.rep_call.failed:
        sauce.setTestStatus("failed")
    else:
        sauce.setTestStatus("passed")

    sauce.stop()
Ejemplo n.º 9
0
    def test_creates_a_session_on_sauce_labs(self):
        session = SauceSession()

        session.start()

        assert session.driver.session_id
Ejemplo n.º 10
0
    def test_failing_case(self):
        session = SauceSession()

        session.start()

        session.stop(False)
Ejemplo n.º 11
0
    def test_passing_case(self):
        session = SauceSession()

        session.start()

        session.stop(True)
Ejemplo n.º 12
0
"""Most basic example of using Simple Sauce.

Here we start a session on Sauce, perform some actions then close the session.
"""
from simplesauce.session import SauceSession


session = SauceSession()

session.start()
session.driver.get("https://www.saucedemo.com")

assert "Swag" in session.driver.title

session.stop()
Ejemplo n.º 13
0
    def test_it_quits_the_driver(self):
        session = SauceSession()

        session.start()

        session.stop()