Skip to content

amOutsideAngularApp is needed before all lines #458

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

Closed
kristho91 opened this issue Apr 6, 2017 · 1 comment
Closed

amOutsideAngularApp is needed before all lines #458

kristho91 opened this issue Apr 6, 2017 · 1 comment
Labels

Comments

@kristho91
Copy link

What are you trying to achieve?

I am trying to test a non-angular page with CodeceptJS and Protractor. I expect amOutsideAngularApp to hold it's value until I run amInsideAngularApp. But it does not - it seems.
It works if I add amOutsideAngularApp before the I.see(xxx) line too.

Provide console output if related. Use --verbose mode for more details.

CodeceptJS v0.5.1
Using test root "C:\****"

Testing something basic --
   [1] Starting recording promises
   Emitted | suite.before
   [1] Queued | hook Protractor._beforeSuite()
 test something
 > [Session] Starting singleton browser session
   [2] Starting recording promises
   Emitted | test.before
   [2] Queued | hook Protractor._before()
   Emitted | test.start ([object Object])
   Emitted | step.before (I am outside angular app )
   [2] Queued | amOutsideAngularApp: 
   Emitted | step.after (I am outside angular app )
   [2] Queued | return step result
   Emitted | step.before (I am on page "/")
   [2] Queued | amOnPage: "/"
   Emitted | step.after (I am on page "/")
   [2] Queued | return step result
   Emitted | step.before (I see "Login")
   [2] Queued | see: "Login"
   Emitted | step.after (I see "Login")
   [2] Queued | return step result
   [2] Queued | fire test.passed
   [2] Queued | finish test
   Emitted | step.start (I am outside angular app )
 * I am outside angular app 
   Emitted | step.start (I am on page "/")
 * I am on page "/"
   Emitted | step.start (I see "Login")
 * I see "Login"
   [2] Error | Error: Error while waiting for Protractor to sync with the page: "window.angular is undefined.  This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping.  See http://git.io/v4gXM for details"
   [2] Starting <teardown> session
   Emitted | test.failed ([object Object])
   [2] <teardown> Queued | hook Protractor._failed()
   [2] <teardown> Queued | () => done(err)
   [2] <teardown> Stopping recording promises
 > Screenshot has been saved to C:\****\test_something.failed.png
 × FAILED in 5372ms

   Emitted | test.after
   [2] <teardown> Queued | hook Protractor._after()
 > [Session] cleaning cookies and localStorage
   [3] Starting recording promises
   Emitted | suite.after
   [3] Queued | hook Protractor._afterSuite()

-- FAILURES:

  1) Testing something basic: test something:
     Error while waiting for Protractor to sync with the page: "window.angular is undefined.  This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping.  See http://git.io/v4gXM for details"
  
  Scenario Steps:
  
  - I.see("Login") at Test.Scenario (Scripts\test\e2e\first_test.js:8:4)
  - I.amOnPage("/") at Test.Scenario (Scripts\test\e2e\first_test.js:7:4)
  - I.amOutsideAngularApp() at Test.Scenario (Scripts\test\e2e\first_test.js:6:4)
  
  Error: Error while waiting for Protractor to sync with the page: "window.angular is undefined.  This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping.  See http://git.io/v4gXM for details"
      at runWaitForAngularScript.then (node_modules\protractor\built\browser.js:461:23)
      at ManagedPromise.invokeCallback_ (node_modules\selenium-webdriver\lib\promise.js:1366:14)
      at TaskQueue.execute_ (node_modules\selenium-webdriver\lib\promise.js:2970:14)
      at TaskQueue.executeNext_ (node_modules\selenium-webdriver\lib\promise.js:2953:27)
      at asyncRun (node_modules\selenium-webdriver\lib\promise.js:2813:27)
      at node_modules\selenium-webdriver\lib\promise.js:676:7
      at process._tickCallback (internal/process/next_tick.js:103:7)


  FAIL  | 0 passed, 1 failed   // 5s
   Emitted | global.result ([object Object])
   [3] Error | WebDriverError: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
System info: host: 'KT-LENOVO', ip: '10.160.8.2', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: EventFiringWebDriver
   [3] Stopping recording promises

Provide test source code if related

Feature("Testing something basic");

Scenario("test something", (I) => {
	I.amOutsideAngularApp();
	I.amOnPage("/");
	I.see("Login");
});

Details

  • CodeceptJS version: 0.5.1
  • NodeJS Version: 6.10
  • Operating System: Windows 10
  • Protractor version: 5.1.1
  • Configuration file:
{
	"tests": "./Scripts/test/e2e/*_test.js",
	"timeout": 10000,
	"output": "./Scripts/test/e2e/output",
	"helpers": {
		"Protractor": {
			"url": "http://***",
			"driver": "hosted",
			"browser": "firefox",
			"rootElement": "body"
		}
	},
	"include": {},
	"bootstrap": false,
	"mocha": {},
	"name": "***"
}
@leandroz
Copy link

I am in an Ionic app and once the test finishes I am getting:
WebDriverError: Session ID is null. Using WebDriver after calling quit()?
Driver info: driver.version: RemoteWebDriver
From: Task: WebDriver.manage().timeouts().setScriptTimeout(10000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants