Results 1 to 8 of 8

Thread: Independent Tests

  1. #1

    Default Independent Tests

    Hello,

    I am wondering if there is a way to separate my test cases. I would like to have them run in their own browser/webdriver instance, but still be started as a group. Is there a way to make the webdriver close and then restart for the next test?

    Thank you!

  2. #2
    Sencha - Test Dev Team marcelofarias's Avatar
    Join Date
    Nov 2011
    Location
    Boca Raton, FL
    Posts
    75
    Answers
    5

    Default

    Sencha Tests will always run your tests independently for each selected browser. Even better, they run in parallel


    A little bit more in-depth explanation:

    Sencha Test will always have isolated contexts for each selected browser. For in-browser scenarios you will have one (*) instance of each browser running all the specs. For WebDriver scenarios, you will have one (*) sandbox (in fact, an Electron child process) for each selected browser, each one with its own Selenium/WebDriver client.

    * It can actually be more than one, if you specify a higher concurrency for any browser in the browser pool configuration. In that case Sencha Test will split your test in N parallel tasks, each one running a subset of the test files in the selected scenario.

    Regards
    Marcelo Bukowski de Farias

  3. #3

    Default

    I think I phrased this question incorrectly. What I meant is if I have two js files in a scenario, I want to run the tests in the first js file, close the window, and then open a new one for the the next test file. Or do I just have to make a new scenario for each test?

    Thanks!

  4. #4
    Sencha - Test Dev Team marcelofarias's Avatar
    Join Date
    Nov 2011
    Location
    Boca Raton, FL
    Posts
    75
    Answers
    5

    Default

    Hi Alex, thanks for the feedback. I see what you're trying to achieve, and although we currently don't have an option to always get a new browser window for each file, there are at least 4 ways you can accomplish the desired behavior:

    1) Use ST.navigate() whenever you want to ensure the page was just refreshed. See: http://docs.sencha.com/sencha_test/2...ethod-navigate

    2) Use multiple browser instances. See: https://www.sencha.com/blog/using-mu...h-sencha-test/

    3) Use multiple scenarios, as you mentioned

    4) Specify a high concurrency value for each browser in the pool. If the concurrency value is greater then the number of test files, it will be capped, so you can safely specify a really big number here (like 9999, for instance). This way, you will have a completely separated environment (and therefore a separated browser window) for each test file

    Regards
    Marcelo Bukowski de Farias

  5. #5

    Default

    Ok, I can make that work, thank you!

  6. #6
    Sencha User
    Join Date
    Jul 2015
    Posts
    22
    Answers
    1

    Default

    Dear marcelofarias

    I'm trying to use ST.navigate() as you suggested in 'InBrowser' test suite type and it always fail. I'm always getting error:
    Failed with error "For in-browser tests, ST.navigate() can only be used for fragment URLs, not for full redirection."
    This means to me that only "routes" are supported which doesn't refresh the application. Is there any other way to achieve refresh of the app before each test?
    My prerequisite it to use 'InBrowser' tests, only using chrome browser and without opening multiple windows. What I need is simple F5 action before each test

    Thank you for help
    Slawek

  7. #7
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    338
    Answers
    55

    Default

    For In-Browser scenarios, the browser cannot be refreshed during a test run, as that causes a physical page navigation and a disconnect to occur between the test runner and the browser session. Is there a particular reason why the app needs to be refreshed between each test?
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  8. #8
    Sencha User
    Join Date
    Jul 2015
    Posts
    22
    Answers
    1

    Default

    Dear Daniel

    I wanted to test some scenarios that in my opinion should be grouped in one test suite. Let's say I want to test the behaviors of application during login. So first test would be to check if application (or login page) pass you through with invalid credentials and then the second test it you'll be logged in wit valid credentials. It think it make sense. And for each of this tests I'd like to start application freshly because otherwise after completion of the previous test application can be in some special state (e.g showing some alerts etc.). Of course this can be also handled but I'd like to have clear state before every test

    Regards
    Slawek

Similar Threads

  1. Running Unit Tests hangs saying "Loading Tests"
    By nathaniel.fields in forum Q&A
    Replies: 8
    Last Post: 31 May 2016, 1:25 AM
  2. How can I create independent stores?
    By Reverent in forum Ext 5: Q&A
    Replies: 3
    Last Post: 23 Jun 2015, 3:22 PM
  3. Independent Pop-up Form
    By charles.dumont in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 16 Nov 2007, 2:40 PM
  4. Will Ext 1.0 be independent from YUI?
    By schmidetzki in forum Community Discussion
    Replies: 1
    Last Post: 12 Feb 2007, 2:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •