Skip to content

Support test with regular webserver #129

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
MikeMitterer opened this issue May 28, 2015 · 2 comments
Closed

Support test with regular webserver #129

MikeMitterer opened this issue May 28, 2015 · 2 comments

Comments

@MikeMitterer
Copy link

If I start the test with mylocalserver --port 8080 I get

 GET http://localhost:8080/test.dart.browser_test.dart dart.js:67 window.onload

this is my custom html file

<!doctype html>
<!-- custom_html_test.html -->
<html>
<head>
    <title>Custom HTML Test</title>
    <link rel="x-dart-test" href="test.dart">
    <!-- it works if I uncomment the following line but then I get the above error message --> 
    <!--<script async type="application/dart" src="test.dart"></script>-->
    <script src="packages/test/dart.js"></script>

    <link rel="stylesheet" href="packages/mdl/assets/styles/material.min.css">
</head>
<body>

<div class="ui-test ui-test-button">
    <button id="button1" class="mdl-button mdl-js-button">Flat</button>
</div>

</body>
</html>

It works fine with

pub run test:test -p dartium test/unit/test.dart

The problem is that with pub run test:test -p dartium test/unit/test.dart the browser pops up, runs the test and closes. This is not enough. In my case there is also a visual test necessary - means I have to see!!!! how my Dart-Script modified the button.
screenshot-1786

See my SS - I must see how "FLAT" looks like

@zoechi
Copy link

zoechi commented May 28, 2015

If you need to see it you will probably need to change <link rel="x-dart-test" href="test.dart"> to a proper dart script tag, then you can launch the HTML page manually.
I have no idea how this will work out when this way of running tests is deprecated (as announced). For automatic test runs such a manual visual check wouldn't make much sense anyway (maybe using WebDriver, which can be used in combination with this test package).

@nex3
Copy link
Member

nex3 commented May 28, 2015

The test package is designed for automated testing; manual testing is a non-goal. You'll be able to see the results of the tests with #45, but that's not going to be its primary purpose. I suggest you don't use this test framework for writing manual tests.

@nex3 nex3 closed this as completed May 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants