Beispiel #1
0
def test_should_waitFor_passes_when_element_is_not_visible_it_fails(
        app_server):
    with raises(node.NodeError):
        app_server(
            jsawait(
                waitFor(element(
                    by.id("notthere"))).toBeVisible().withTimeout(2000)))
Beispiel #2
0
def detox_server(detox_node_server):
    ios_sim_release = {
        "binaryPath":
        "ios/build/Build/Products/Release-iphonesimulator/example.app",
        "type": "ios.simulator",
        "device": {
            "type": "iPhone 11"
        },
    }
    configurations_obj = {
        "configurations": {
            "ios.sim.release": ios_sim_release
        },
        "selectedConfiguration": "ios.sim.release",
    }
    detox_node_server(jsawait(detox.init(configurations_obj)), timeout=360)
    yield detox_node_server
    detox_node_server(jsawait(detox.cleanup()))
Beispiel #3
0
def test_should_raise_exception_after_tap_since_expectation_hasnt_been_met(
        app_server):
    app_server(jsawait(element(by.id("world_button")).tap()))
    with raises(node.NodeError):
        app_server(
            jsawait(expect(element(by.label("NotVisible!!!"))).toBeVisible()))
Beispiel #4
0
def test_should_waitFor_passes_when_element_is_visible(app_server):
    app_server(
        jsawait(
            waitFor(element(
                by.id("world_button"))).toBeVisible().withTimeout(2000)))
Beispiel #5
0
def test_should_show_world_after_tap(app_server):
    app_server(jsawait(element(by.id("world_button")).tap()))
    app_server(jsawait(expect(element(by.label("World!!!"))).toBeVisible()))
Beispiel #6
0
def test_should_show_hello_after_tap(app_server):
    app_server(jsawait(element(by.id("hello_button")).tap()))
    app_server(jsawait(expect(element(by.label("Hello!!!"))).toBeVisible()))
Beispiel #7
0
def test_welcome_screen_is_displayed(app_server):
    app_server(jsawait(expect(element(by.id("welcome"))).toBeVisible()))
Beispiel #8
0
def app_server(detox_server):
    detox_server(jsawait(device.reloadReactNative()))
    yield detox_server