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

BeforeSuite and AfterSuite implement #231

Merged
merged 11 commits into from Oct 2, 2016

Conversation

Projects
None yet
2 participants
@APshenkin
Collaborator

APshenkin commented Sep 21, 2016

For #232

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Sep 21, 2016

Member

Thank you. I will need some time to have a deep look. So this is Work In Progress?

Member

DavertMik commented Sep 21, 2016

Thank you. I will need some time to have a deep look. So this is Work In Progress?

@APshenkin

This comment has been minimized.

Show comment
Hide comment
@APshenkin

APshenkin Sep 22, 2016

Collaborator

@DavertMik Yes. This enhancement is "In progress". I have problem with AfterSuite hook, when any scenario was failed during test run. Please check #232

Collaborator

APshenkin commented Sep 22, 2016

@DavertMik Yes. This enhancement is "In progress". I have problem with AfterSuite hook, when any scenario was failed during test run. Please check #232

@APshenkin

This comment has been minimized.

Show comment
Hide comment
@APshenkin

APshenkin Sep 22, 2016

Collaborator

@DavertMik Looks like I fixed the issue with AfterSuite Hook. Now it works! Please review.
Any suggestions will be interesting.

BTW tested with WebdriverIO helper on Windows

Collaborator

APshenkin commented Sep 22, 2016

@DavertMik Looks like I fixed the issue with AfterSuite Hook. Now it works! Please review.
Any suggestions will be interesting.

BTW tested with WebdriverIO helper on Windows

@APshenkin

This comment has been minimized.

Show comment
Hide comment
@APshenkin

APshenkin Sep 23, 2016

Collaborator

@DavertMik When you will be able to check this changes? Looks like it's working!

Collaborator

APshenkin commented Sep 23, 2016

@DavertMik When you will be able to check this changes? Looks like it's working!

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Sep 23, 2016

Member

That's really cool. I hope I will have a time to review and merge it after the weekend. Thanks for your work.

Member

DavertMik commented Sep 23, 2016

That's really cool. I hope I will have a time to review and merge it after the weekend. Thanks for your work.

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Sep 23, 2016

Member

What I need from you is an example of usage of this feature so I could document it.
If you can, please add some real life sample. Why you needed this feature.

Member

DavertMik commented Sep 23, 2016

What I need from you is an example of usage of this feature so I could document it.
If you can, please add some real life sample. Why you needed this feature.

@APshenkin

This comment has been minimized.

Show comment
Hide comment
@APshenkin

APshenkin Sep 26, 2016

Collaborator

@DavertMik
Here is sample from my real life:)
During tests I use webdrivercss to test CSS https://github.com/webdriverio/webdrivercss . So for this I need reference screenshots. It's very expensive, to save all screenshots to repository, because the repository will be too large and also during tests run you don't need all screenshots. Because of this I use the remote server to save screenshots. Before tests I have to download them and during scenarios I check the CSS using these screenshots. And after test suite I upload difference to remote server.

Also You can use these feature, If your web application has any integration with client application. E.g. web application connects to client application in my project using Websockets to send/get information about installed apps(games) and statuses about installation on PC. Also webapplication calls client app to launch the game. So in my web tests sometimes I need to install different versions of client app for tests (with different settings) to check that everything works well. But I don't need to reinstall app after each test or one time (on launching tests). Because of this BeforeSuite|AfterSuite are best for me

Collaborator

APshenkin commented Sep 26, 2016

@DavertMik
Here is sample from my real life:)
During tests I use webdrivercss to test CSS https://github.com/webdriverio/webdrivercss . So for this I need reference screenshots. It's very expensive, to save all screenshots to repository, because the repository will be too large and also during tests run you don't need all screenshots. Because of this I use the remote server to save screenshots. Before tests I have to download them and during scenarios I check the CSS using these screenshots. And after test suite I upload difference to remote server.

Also You can use these feature, If your web application has any integration with client application. E.g. web application connects to client application in my project using Websockets to send/get information about installed apps(games) and statuses about installation on PC. Also webapplication calls client app to launch the game. So in my web tests sometimes I need to install different versions of client app for tests (with different settings) to check that everything works well. But I don't need to reinstall app after each test or one time (on launching tests). Because of this BeforeSuite|AfterSuite are best for me

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Oct 2, 2016

Member

Thank you very much! That was awesome work

Member

DavertMik commented Oct 2, 2016

Thank you very much! That was awesome work

@DavertMik DavertMik merged commit 0ee1efc into Codeception:master Oct 2, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Oct 2, 2016

Member

Just a question BeforeSuite will work for all files in suite or only for a file where it was declared?

Member

DavertMik commented Oct 2, 2016

Just a question BeforeSuite will work for all files in suite or only for a file where it was declared?

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Oct 2, 2016

Member

Ok, I didn't come to a better way to write about it than to cite you on site http://codecept.io/basics/#beforeSuite

If you think this can be improved, please edit https://github.com/Codeception/CodeceptJS/blob/master/docs/basics.md

Member

DavertMik commented Oct 2, 2016

Ok, I didn't come to a better way to write about it than to cite you on site http://codecept.io/basics/#beforeSuite

If you think this can be improved, please edit https://github.com/Codeception/CodeceptJS/blob/master/docs/basics.md

@APshenkin

This comment has been minimized.

Show comment
Hide comment
@APshenkin

APshenkin Oct 3, 2016

Collaborator

@DavertMik Only for a file, where it was declared.

BTW, beforeSuite and afterSuite have access to I object. here is a sample from my tests:

BeforeSuite((I) => {
    I.syncDown('4game-referral-system', 'acc-1-qa-auth-referral');
});

note: I create custom handler in my custom helper to sync files from remote server. It'works as usual I function. But in BeforeSuite/AfterSuite you don't have an access to browser because it's not running in this moment. Will update the docs and send new PR

Collaborator

APshenkin commented Oct 3, 2016

@DavertMik Only for a file, where it was declared.

BTW, beforeSuite and afterSuite have access to I object. here is a sample from my tests:

BeforeSuite((I) => {
    I.syncDown('4game-referral-system', 'acc-1-qa-auth-referral');
});

note: I create custom handler in my custom helper to sync files from remote server. It'works as usual I function. But in BeforeSuite/AfterSuite you don't have an access to browser because it's not running in this moment. Will update the docs and send new PR

Nighthawk14 added a commit to Nighthawk14/CodeceptJS that referenced this pull request Nov 7, 2016

Update upstream (#2)
* fixed definition generation

* Fix def command (Codeception#223)

* Fix def command

Container does not have getTranslations() method, just translation().

* Fix def command

Fix typo in previous commit.

* updated version and changelog

* BeforeSuite and AfterSuite implement (Codeception#231)

* close tabs after test, close browser after all tests

* revert changes, fix afterAll

* experemental

* Implement BeforeSuite AfterSuite

* Remove temp changes

* remove formatting

* remove formatting

* remove Formatting

* Fix AfterSuite Hook

* Fix formatting

* updated docs for beforesuite

* version bump

* small fixes

* Update docs for beforeSuite/afterSuite and fix restart false (Codeception#240)

* close tabs after test, close browser after all tests

* revert changes, fix afterAll

* experemental

* Implement BeforeSuite AfterSuite

* Remove temp changes

* remove formatting

* remove formatting

* remove Formatting

* Fix AfterSuite Hook

* Fix formatting

* Update docs

* Update docs 2

* Update docs 3

* Fix "restart: false"

* version bump

* updated version, changelog

* updated docs

* Update attachFile.mustache

* Update SeleniumWebdriver.js

* Use global actor function in Page Objects docs (Codeception#251)

* Use global actor function in Page Objects docs

As suggested in https://github.com/Codeception/CodeceptJS/blob/master/CHANGELOG.md#022 , otherwise the example code might not work as expected.

* Update remaining usages of 'codeceptjs/actor'

* Fix attachFile on WebDriverIO helper (Codeception#254)

* Fix attachFile on WebDriverIO helper

* Improve check on returned element

* Update to helpers docs (Codeception#264)

* update to helpers docs

* updated docs

* fixed file uploads fro WebDriverIO (Codeception#265)

* Update helpers.md

* Update helpers.md

* Add support for webdriver.io timeouts (Codeception#258)

This adds support for each possible timeouts option in webdriver.io

In your codecept.conf.js you can express it something like:

```
{
  ...
  WebDriverIO: {
    url: 'http://localhost:8080',
    browser: 'phantomjs',
    timeouts: {
      implicit: 10000,
      page_load: 20000
      script: 5000
    }
  }
}
```

* do not throw error in dispatcher (Codeception#263)

* do not throw error, emit it!

fix issue Codeception#262

* remove emit error

* catch mocha fail

* Improved timeouts for WebdriverIO (Codeception#267)

* added timeouts to config section and defineTimeout method

* tiny typo

* fixed Nightmare bug: unable to locate and click element; async improv… (Codeception#268)

* fixed Nightmare bug: unable to locate and click element; async improvements

* added fix and test for Nightmare not located clicable element

* fix test generation (Codeception#260)

* using unlinkSync to prepare tests

* Added option to manually start the browser. (Codeception#255)

* Added manual option to WebDriverIO helper, to start client manualy.

* Added option to manualy start the browser.

* added config param in docs

* Generators fix (Codeception#270)

* added mkdirp for recursive directory creation

* init creates all required dirs

* Added config option descriptions for manualStart option (Codeception#271)

* added config option descriptions for manualStart option

* manual start renamed back

* Added moveCursorTo to Protractor, Nightmare, SeleniumWebdriver (Codeception#269)

* [SeleniumWebdriver][Protrctor][Nightmare] Added moveCursorTo and basic test

* added wait for hover test

* fixed moveCursorTo test

* another try to fix hover test

* fixed test

* another try for the test fix

* disabling hover test

* updated changelog

* updated docs

* fixed gt example

* updated mocha to fix security issue (Codeception#273)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment