Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Test does not pass: async events #3116

Closed
cnishina opened this issue Apr 11, 2016 · 3 comments
Closed

Test does not pass: async events #3116

cnishina opened this issue Apr 11, 2016 · 3 comments

Comments

@cnishina
Copy link
Member

Spec:

node built/cli.js spec/errorTest/slowHttpAndTimeoutConf.js --untrackOutstandingTimeouts true

Log:

Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Started
FA Jasmine spec timed out. Resetting the WebDriver Control Flow.
F

Failures:
1) slow asynchronous events waits for http calls
  Message:
    Expected 'pending...' to equal 'done'.
  Stack:
    Error: Failed expectation
        at Object.<anonymous> (/media/sf_protractor/spec/errorTest/baseCase/slow_http_and_timeout_spec.js:14:30)
        at /media/sf_protractor/node_modules/jasminewd2/index.js:96:23
        at new Promise (/media/sf_protractor/node_modules/selenium-webdriver/lib/promise.js:1043:7)
        at controlFlowExecute (/media/sf_protractor/node_modules/jasminewd2/index.js:82:18)
        at TaskQueue.execute_ (/media/sf_protractor/node_modules/selenium-webdriver/lib/promise.js:2790:14)
        at TaskQueue.executeNext_ (/media/sf_protractor/node_modules/selenium-webdriver/lib/promise.js:2773:21)
        at /media/sf_protractor/node_modules/selenium-webdriver/lib/promise.js:2697:25
        at /media/sf_protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
        at process._tickCallback (node.js:406:9)

2) slow asynchronous events waits for $timeout
  Message:
    Failed: Timed out waiting for Protractor to synchronize with the page after 1 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md
     - Locator: by.binding("slowAngularTimeoutStatus")
  Stack:
    Error: Failed: Timed out waiting for Protractor to synchronize with the page after 1 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md
     - Locator: by.binding("slowAngularTimeoutStatus")
        at /media/sf_protractor/node_modules/jasminewd2/index.js:101:16
        at Promise.invokeCallback_ (/media/sf_protractor/node_modules/selenium-webdriver/lib/promise.js:1329:14)
        at TaskQueue.execute_ (/media/sf_protractor/node_modules/selenium-webdriver/lib/promise.js:2790:14)
        at TaskQueue.executeNext_ (/media/sf_protractor/node_modules/selenium-webdriver/lib/promise.js:2773:21)

2 specs, 2 failures
Finished in 3.385 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #01 failed 2 test(s)
[launcher] overall: 2 failed spec(s)
[launcher] Process exited with error code 1
>>> fail: Error: did not fail with expected error with message: [The following tasks were pending[\s\S]*\$http: slowcall]
Summary: fail
npm ERR! Test failed.  See above for more details.
@cnishina
Copy link
Member Author

cnishina commented Apr 19, 2016

I probably don't know enough about this bug... but this synchronization can be achieved:

    var status = element(by.binding('slowHttpStatus'));
    var button = element(by.css('[ng-click="slowHttp()"]'));

    expect(status.getText()).toEqual('not started');

    browser.ignoreSynchronization = false;   // "fix"
    button.click();
    browser.ignoreSynchronization = true;   // "fix"

    expect(status.getText()).toEqual('pending...');   // "fix"

    // expect(status.getText()).toEqual('done'); 

I commented out expecting 'done'. I am not sure if it supposed to wait till done appears.

@juliemr
Copy link
Member

juliemr commented Apr 21, 2016

These tests are supposed to fail. They are causing npm test to be unhappy because the way they are supposed to fail with the right message:

>>> fail: Error: did not fail with expected error with message: [^((?!The following tasks were pending).)*$]

@juliemr
Copy link
Member

juliemr commented Apr 21, 2016

Ah! This is because of b6f1a63

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