browserstack / browserstack-runner

MIT License
131 stars 61 forks source link

Can't import files from an outside relative path? #213

Open alvarotrigo opened 5 years ago

alvarotrigo commented 5 years ago

When importing files in my index.html that are relative to a folder outside theindex.html one, the test seems to fail as it seems it is not importing those files. I start getting messages like "X is not defined", "X is not a constructor" etc.

Expected Behavior

Using relative paths pointing to files outside the main folder should work.

Actual Behavior

Using relative paths pointing to files outside the main folder doesn't work.

Steps to Reproduce the Problem

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="./nada/qunit-1.18.0.css">
        <script type="text/javascript" src="../src/demo.js"></script>
    </head>
    <body>
        <div id="qunit"></div>
        <div id="qunit-fixture"></div>

        <script src="./nada/qunit-2.5.1.js"></script>
        <script type="text/javascript">
            QUnit.test("isEven returns true for even numbers", function(assert){
                assert.ok(isEven(10), "10 is even");
            });
        </script>
    </body>
</html>

Showing the following error:

isEven is not defined

Which won't show when changing the demo.js file path from ../src/ to ./ or any subfolder within the same folder.

<script type="text/javascript" src="../test/demo.js"></script>

browserstack.json

{
    "test_framework" : "qunit",
    "test_path": "pepe.html",
    "browsers": [
        "firefox_previous"
    ]
}

Platform details

  1. browserstack-runner version: latest
  2. node version: v10.13.0
  3. os type and version: Mac OS X 10.14.3

Details

yuvrajgohil24 commented 9 months ago

Hey @alvarotrigo I am facing an issue while setup the browserstack-runner rep. locally After writing the browserstack-runner an error occurs which says "browserstack.json is missing" browser-stack