Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !1457

Fix acceptance tests on Linux

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Pablo Brasero requested to merge github/fork/pablobm/phantomjs-linux-fix into master Nov 01, 2019
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

Currently, several acceptance specs fail in my Debian machine. The errors suggest that some pages don't have some expected content, and while the specs are running we get a mysterious message that looks like this:

Not allowed to load local resource: file:///admin/log_entries/1

The culprit is the JS that makes table rows clickable. They extract the href from the link cell and apply it to window.location. Normally this works: it's a path URL (eg: /admin/log_entries/1) and the result preserves the current scheme+host (eg: if we were at http://localhost:12345/admin/products, we'll end up with http://localhost:12345/admin_log_entries/1).

Unfortunately, the behaviour on PhantomJS under Debian Stretch is different. In this case, the scheme+host are lost, and we end up with a file:// URL, and therefore with file:///admin/log_entries/1.

As a result, links are not followed through, and therefore we don't move on to the next page, and specs fail to find the expected content.

Assigning the URI to window.location.pathname instead solves the problem.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pablobm/phantomjs-linux-fix