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

Safari Technology Preview can't find Angular 1 #4004

Open

Description

@thorn0

Starting with the Release 19, Safari Technology Preview is incompatible with Protractor.

See https://webkit.org/blog/7093/release-notes-for-safari-technology-preview-19/:

Changed window.name to be cleared after a cross-origin navigation (r209076)

So if we try to test an Angular 1 app there, we get angular never provided resumeBootstrap.

I wish we didn't need the Preview in the first place and could just use the release version of Safari 10, but the web driver implementation in the release is broken. Specifically, visibility checks aren't implemented in it, which has been fixed in the preview.

Protractor 4.0.14 (tried 5.0.0 too), Node 6.9,4, Selenium Standalone Server 3.0.1, macOS 10.12

Activity

  1. heathkit commented on Jan 27, 2017

    @heathkit
    Contributor

    Well, that's not good.

  2. thorn0 commented on Jan 27, 2017

    @thorn0
    ContributorAuthor

    On the other hand, it has navigator.webdriver set to true when WebDriver is active. So my current workaround is

    if (navigator.webdriver) {
      window.name = "NG_DEFER_BOOTSTRAP!" + window.name;
    }

    before calling angular.bootstrap.

  3. heathkit commented on May 1, 2017

    @heathkit
    Contributor

    So, the root issue with Safari is "window.name leaks information across domains". Which is true, this is the exact property that Protractor exploits to tell Angular that it's in an E2E test before the browser navigates to the page.

    The only way I can see to fix this would be to implement @sjelin's plan for handling browser-initiated navigation, but even that wouldn't totally fix things.

    Fundamentally, Protractor depends on some form of cross-domain information leaking so it can signal to Angular that it's running in a test. The alternative would be to load the app (or any page on that domain, I guess) and set something in sessionStore, then reload the app for testing. Alternately, Protractor could use a proxy to inject javascript before the app loads.

  4. underscorebrody commented on Nov 7, 2017

    @underscorebrody

    This appears to be an issue now in Chrome 63 (which is in the beta channel) as well

  5. underscorebrody commented on Nov 7, 2017

    @underscorebrody

    @heathkit I think this is going to become a much more prevalent issue very soon...

  6. flo223 commented on Feb 14, 2018

    @flo223

    Any news about this issue?
    We currently use Protractor 5.2.2 with Safari 11.0.3 and we're unable to make it work because of this error.

    We have an Angular 1 app and we basically cannot run our tests for Safari, which represents a great portion of our user base.

    Can we conclude that Protractor does not work with Safari 11 for Angular 1 app?

    Any workaround or short term solution planned?

    Many thanks in advance!

  7. thorn0 commented on Feb 14, 2018

    @thorn0
    ContributorAuthor

    @flo223 I wrote what my workaround was. Does it not work for you?

  8. thorn0 commented on Apr 20, 2018

    @thorn0
    ContributorAuthor

    @GiovanyR Before the angular.bootstrap call.

  9. evilaliv3 commented on Jun 5, 2020

    @evilaliv3
    Contributor

    @thorn0 : Do you have an example where i can look?

    I'm trying a possible solution that could be written inside the protractor configuration file.

  10. thorn0 commented on Jun 5, 2020

    @thorn0
    ContributorAuthor

    @evilaliv3 It can't be written there. It's something you need to do in the app code before bootstrapping AngularJS. I didn't touch those things for years and have no idea whether that workaround still works.

  11. Splaktar commented on Apr 3, 2021

    @Splaktar
  12. yoavweiss commented on Apr 8, 2021

    @yoavweiss

    There's an intent to similarly break this in Chromium. Do y'all have plans to stop relying on window.name for cross-site communication?

  13. Splaktar commented on Jun 7, 2021

    @Splaktar

    @yoavweiss not at this time. We need to come up with some...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions