Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from Mocha to another lib #94

Closed
padupuy opened this issue Mar 5, 2017 · 1 comment
Closed

Switch from Mocha to another lib #94

padupuy opened this issue Mar 5, 2017 · 1 comment

Comments

@padupuy
Copy link

padupuy commented Mar 5, 2017

Hello @rotemmiz @LeoNatan,
I'm not a big fan of Mocha test framework because a lot of things seems to be magic.
When I look at the examples https://github.com/wix/detox/blob/master/detox/test/e2e/a-sanity.js I don't understand where the different methods come from - describe, beforeEach, it, expect -
It's really confusing to understand what comes from the test framework or from Detox, you have to search deep to discover where comes from the magic https://github.com/wix/detox/blob/master/detox/src/ios/expect.js#L357

Is there any plan to be test framework agnostic ?

It will be awesome Detox works with Ava https://github.com/avajs/ava and expose a verbose API.

import DetoxClient, {element, expect} from 'detox';
import test from 'ava';

const DETOX_CONFIG = {
...
};

let client;
test.before(async () => {
    client = DetoxClient.init(DETOX_CONFIG);
    await client.start();
});

test('my passing test', async () => {
    await element(by.id('username')).replaceText('admin');
    await element(by.id('password')).replaceText('admin');
    await element(by.label('loginButton')).tap();
    await expect(element(by.label('Welcome'))).toBeVisible();
});

test.afterEach.always(async () => {
    await client.waitForTestResult();
});

test.after.always(async () => {
    await client.cleanup();
});

@LeoNatan LeoNatan changed the title [feature] Switch from Mocha to another lib Switch from Mocha to another lib Jul 7, 2017
@LeoNatan
Copy link
Contributor

LeoNatan commented Mar 7, 2018

Detox is runner agnostic and will work with other runners, such as Jest and Ava.

@LeoNatan LeoNatan closed this as completed Mar 7, 2018
@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants