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

Test reformating. #1690

Closed
sebv opened this issue Jan 2, 2014 · 9 comments · May be fixed by EdtechFoundry/appium#29
Closed

Test reformating. #1690

sebv opened this issue Jan 2, 2014 · 9 comments · May be fixed by EdtechFoundry/appium#29
Labels
Documentation related to writing, reading, or generating documentation Enhancement feature

Comments

@sebv
Copy link
Member

sebv commented Jan 2, 2014

I've started reformatting the tests using newer/better wd syntax. You can see a sample here (Don't try to run it yet, it's not ready):

https://github.com/sebv/appium/blob/wd_promise_chain/test/helpers/webview.js

Let me know if it is ok, and I'll do the whole suite like that.

@sebv
Copy link
Member Author

sebv commented Jan 7, 2014

@jlipps can you check this https://github.com/sebv/appium/compare/wd_promise_chain, reformated safari tests (including web view helper), it's working and is faster. Am planning to convert the whole suite on this model.

@jlipps
Copy link
Member

jlipps commented Jan 7, 2014

my biggest concern is the change from beforeEach/afterEach to beforeAll/afterAll in driverblock. This will likely break most of the tests. Each test is written with the assumption that it is run in a clean session.

What are you doing to address this?

Also, we'll probably rewrite all the tests using yiewd at some point, so be forewarned :-)

@bootstraponline
Copy link
Member

Does yiewd produce more readable code than promise chains?

@jlipps
Copy link
Member

jlipps commented Jan 7, 2014

According to me. It's one of those taste things though.

Multi-line chains always frustrate me. But others can't stand the yield keyword everywhere.

@sebv
Copy link
Member Author

sebv commented Jan 8, 2014

@jlipps the tests can also be run in isolation, but I am planning to make the beforeEach/before switch configurable later, and do more work on describe. It's not manageable to have a session for each test in dev.

Those are not your regular multiline-chain (which I deprecated in wd), they are promise first, and execute like promises, It is very easy to break the chain by calling then anytime and start a new chain. If you use monocle, you can even yield them.

I wouldn't mind yiewd, but it requires 0.11 or regenerator, so it's more something for the future. btw yiewd should also use promiseChain in the background, since you can yield promises directly, then that'll fix the yield keyword everywhere thing.

@jlipps
Copy link
Member

jlipps commented Jan 8, 2014

OK, but I think we need to make the beforeEach/before switch configurable now, or else leave the default as is---driverblock is used for all the native tests as well and I am pretty sure things will break if we don't keep it as beforeEach/afterEach for now.

@sebv
Copy link
Member Author

sebv commented Jan 8, 2014

No worry, I'll make sure all the existing test pass (This is what takes me the most time), I'll see what is best for the native test when I am converting the code.

@sebv
Copy link
Member Author

sebv commented Jan 14, 2014

#1732

@sebv sebv closed this as completed Jan 14, 2014
@lock
Copy link

lock bot commented May 4, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators May 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation related to writing, reading, or generating documentation Enhancement feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants