Giter Club home page Giter Club logo

testium's Introduction

testium's People

Contributors

aotarola avatar azu avatar dbushong avatar endangeredmassa avatar hineichris avatar jeloou avatar jesstelford avatar jkrems avatar johan avatar paraggupta1993 avatar readmecritic avatar searls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

testium's Issues

Display actual wait times for waitFor*

Almost certain that it will be hard (impossible) in the current design, but it would be nice to get the actual wait times reported for successful waits.

Example from nightwatch.js:

That example also includes nice trace-like messages for all other assertions. Pretty helpful for test blocks with more than one line.

provide computed style dumps

It will be faster and perhaps less brittle to assert specific style properties of elements instead of full screenshot diffs. Here is an example of how these values can be retrieved.

Does this feature sound useful?

Implement generic sync wait

Would be nice to have a generic sync wait method that can allow for slowing down the test independently of the wait for url/element behaviors.

This can be implemented by the user with a spin wait or the async form of mocha tests but the former seems like it could cause overhead/failures due to CPU utilization and the later seems to oppose the sync goals of the project.

Something like browser.wait(3000); comes to mind.

is evaluate() triggering something in the browser?

Hi,

I'm currently writing some tests on some keyboard navigation on a webpage.
I was trying to change the following (coffeescript):

 truthy 'is visible', @browser.evaluate => # returns true
    @triggerKey(keyList.SPACE, 1)
     $('#ls-lang-list').is(':visible')

to

@browser.evaluate =>
    @triggerKey(keyList.SPACE, 1)
 @browser.waitForElementVisible('#ls-lang-list') # returns false

where @triggerKey(keyList.SPACE, 1) triggers a method that triggers a key for a certain amount of time. In my case the SPACE key opens a menu #ls-lang-list
The first code block works but the second one does not. Somehow evaluate() seems resets or trigger some event / (keystroke?) on the document.

another example:

truthy 'is visible', @browser.evaluate => # returns true
    @triggerKey(keyList.SPACE, 1)
     $('#ls-lang-list').is(':visible')

 truthy 'is visible', @browser.evaluate =>  #returns false
    $('#ls-lang-list').is(':visible')

Invalid selenium.jar in the tmp directory leads to confusing errors

If the download fails or is interrupted, a corrupted file might exist in the temporary directory. Subsequent runs will blindly copy that file and on Mac it's pretty hard to even find the files (they are in directories like /var/folders/1c/98dsd43z92431_bc139nnggn80000gn/T/testium).

It would be great if the temp files would be stored together with their checksum (so it can be checked before copying). Also it's kind of hard to find out where to find the tmp files, maybe that's worth a note in the docs (unless I just wasn't able to find that part).

$ java -jar node_modules/testium/bin/selenium.jar
Error: Invalid or corrupt jarfile node_modules/testium/bin/selenium.jar

[doc] Update the simple example in the README.md

The simple example in the Readme seems specific to groupon's app. I think it will be better if this simple example did something generic - like go to google.com, enter a search query, click on a search button and verified the result.

I'd happily submit a PR if you're OK with this change.

Chrome connection fails after web inspector is opened

OSX 10.9
Chrome: Version 32.0.1700.107

It seems like the data connection fails after the web inspector is opened, causing the next command to fail after opening the inspector.

%> getElement('.guest-button').click()
Error: unknown error: Runtime.evaluate threw exception: TypeError: Cannot call method 'click' of null
  (Session info: chrome=32.0.1700.107)
  (Driver info: chromedriver=2.9.248307,platform=Mac OS X 10.9.1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 9 milliseconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'flynn.homeoffice.wal-mart.com', ip: '172.29.246.84', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.1', java.version: '1.6.0_65'
Session ID: 8675ad9ac13b4fdacbd957b32260ab21
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/0w/60t9x9352g7b55vdx9zff4h00000gn/T/.org.chromium.Chromium.qO2Brc}, rotatable=false, locationContextEnabled=true, version=32.0.1700.107, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]

switch to first-class proxy

Testium inserts a custom proxy between selenium and your app. This provides several features, but is also the source of complexity that has caused bugs in the past.

I would like to swap this out for a premade solution that can accomplish the same thing. That would allow us to have even more features, like capturing HAR files, etc. After looking around, browsermob looks like the best option.

The proxy needs to:

  • strip cache headers
  • mark new page requests (to differentiate between resource requests)
  • auto respond success on first page load
  • store response headers and status code in a special cookie (or some other mechanism)
  • force actual response codes >= 400 to be 200

Instructions for setting up selenium

OS: OS X 10.8.5
node : v0.10.26
testium: v1.7.0
chrome: v35.0.1916.153


I tried to setup testium from the project homepage. When I try to run a basic testium CLI instance, I get an error saying that selenium.jar is not valid. Here's a command log :

➜  tmp  ./node_modules/.bin/testium

/Users/pguruprasad/tmp/node_modules/testium/lib/cli/console.js:70
        throw error;
              ^
Error: Process "selenium" crashed. See log at: /Users/pguruprasad/tmp/node_modules/testium/lib/cli/../../log/selenium.log.
    at procError (/Users/pguruprasad/tmp/node_modules/testium/lib/selenium/process/port.js:47:13)
    at /Users/pguruprasad/tmp/node_modules/testium/lib/selenium/process/port.js:64:19
    at Socket.<anonymous> (/Users/pguruprasad/tmp/node_modules/testium/node_modules/portscanner/lib/portscanner.js:81:5)
    at Socket.EventEmitter.emit (events.js:95:17)
    at TCP.close (net.js:465:12)
➜  tmp  cat /Users/pguruprasad/tmp/node_modules/testium/lib/cli/../../log/selenium.log
[SERVICE] 13:11:24.718 - Starting selenium
[SERVICE] 13:11:24.725 - waiting for selenium to listen on port 4444
Error: Invalid or corrupt jarfile /Users/pguruprasad/tmp/node_modules/testium/bin/selenium.jar

Can you please provide instructions to setup up a working instance of selenium because the instructions provided on this project's repo dont seem to make a correct installation of selenium.

I also made sure that I am using the latest selenium server and selenium chrome driver :

➜  tmp  ./node_modules/.bin/testium --update-selenium
[testium] grabbing selenium standalone server 2.41.0
[testium] grabbing selenium chromedriver 2.9

Clear Individual cookies

Hello,

Is there a particular way of removing individual cookie ? ( or I need to clearCookies() and set the rest of them again ? )

Thanks,
Parag

Aborting proxied requests has unintented consequences

Our app is setup like so:

On url "abc"
  Load important data (A)
    if A fails
      redirect to url "ERROR"
  Asynchronously load other important data (B)
    if B fails
      redirect to url "ERROR"
  ...
  A returns before B
    if (some condition)
      redirect to url "xyz"

When some condition is true, testium's proxy will cancel request B before ending the response to the redirect to url "xyz": https://github.com/groupon-testium/testium/blob/master/src/proxy/proxy.coffee#L68

Because of this, it triggers the B fails condition, and hence the browser redirects to our error URL.

It seems to me that returning a 500 from the proxy at this point is overkill. It's not actually an error, and it's not unreasonable to think that the client might have error handling such as described above that is inadvertently triggered.

Two possible solutions spring to mind:

  1. Call .abort() on the request in a future turn of the event loop to allow the response for a url redirect to complete
  2. Just don't abort the request.

Thoughts.

Improve onboarding when using --download-selenium

Today @timwingfield and I had a rocky onboarding experience with an existing project using Testium. It worked fine when we ran the test suite with phantomjs, but when running with --browser chrome we got an ENOENT error stat'ing node_modules/testium/node_modules/bin/chromedriver.

We didn't know how to proceed so we tried these and they didn't help:

$ npm i -g testium 
$ testium --download-selenium #<-- the README suggested this might work

Then we got the same error. It was only once @EndangeredMassa mentioned we should run locally (e.g. ./node_modules/.bin/testium --download-selenium) that we got to our next error (which was that Java wasn't installed).

Thoughts on improving the onboarding? I feel like it would have been helpful if the README told us to run with the local bin, or if the global actually installed locally. Additionally when the bin is missing (but expected), a clearer error message would have been helpful.

Better way for 'Links Verification'

I need to verify whether all the links present on a page are valid i.e. doesnt give 404 and should not redirect to some other link.
One naive way I found was :

VerifyLink = (browser, link) ->
  preserveLink = browser.getUrl()
  browser.navigateTo("link")
  assert.notEqual( browser.getStatusCode(), 404 )
  assert.equal( browser.getUrl() , link )
  browser.navigateTo(preserveLink) 

I think this method is very costly. Is there a way to parameterize navigateTo with HEAD request. Or some other hack so the browser just checks the links and doesn't navigate to it.

Another Hack I am found using xmlHttpRequest Object :

verifyLink = (browser, link) ->
    js = "var http = new XMLHttpRequest();
          http.open('HEAD', #{link},  false);
          http.send();
          return http.status;"
    status = browser.evaluate(js)
    assert.notEqual 404, status

But this hack cannot test for redirection as xmlHttpRequest follows redirection implicitly.
Any better way to do link verification ?

handling popups?

Hi guys! Couldn't find anything to figure out how to handle popups, e.g. for testing facebook login.

Is there anything, or is it not supported yet?

BTW, the documentation isn't clear that you need mocha.opts created to run tests in coffeescript, you should probably add that, took me a while to figure out why my tests weren't running.

Set Browser Width for Mobile Testing

We love testium. We're trying to use it to test our mobile apps with responsive design, but can't figure out how to set the browser width. Are there any docs available?

`npm test` fails

$ uname -a
Darwin pwony-2.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64

$ phantomjs --version
1.9.2

$ node --version
v0.10.24

$ git clone https://github.com/groupon/testium.git
...

$ cd testium
$ npm install .
$ npm test

> [email protected] test ./testium
> make test


Testing against: phantomjs

[testium] grabbing selenium standalone server 2.39.0
[testium] grabbing selenium chromedriver 2.8

./testium/node_modules/assertive/lib/assertive.js:59
        throw error('Expected ' + red(stringify(bool)) + ' to be ' + name, exp
              ^
Error: Assertion failed: new Driver(targetPort, proxyCommandPort, webdriverServerUrl, desiredCapabilities) - requires webdriverServerUrl
Expected undefined to be truthy
    at error (./testium/node_modules/assertive/lib/assertive.js:365:12)
    at assert.truthy (./testium/node_modules/assertive/lib/assertive.js:59:15)
    at new class$ (./testium/lib/api/index.js:55:7)
    at module.exports.getBrowser (./testium/lib/test_setup/browser.js:58:23)
    at Object.<anonymous> (./testium/lib/test_setup/index.js:38:13)
    at Object.<anonymous> (./testium/lib/test_setup/index.js:74:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
Using phantomjs: 8 failed test(s)
=====================================
All browsers: 8 failed test(s)
make: *** [test] Error 1
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

Enable viewing / asserting Network Requests

I have the following use case:

  • I am developing a single page app
  • Upon load, the app is given an ID from the server
  • Later in the app's usage, that ID is used to PUT information back to the server
  • I need to write a test which checks for the correct ID existing in the PUT. For example:
assert = require 'assertive'
{getBrowser} = require 'testium'

describe 'app', ->
  before ->
    @browser = getBrowser()
    @browser.navigateTo '/form-flow'
    assert.equal 'status code', 200, @browser.getStatusCode()

  it 'uses the correct IDs', ->

    @browser.assert.hasNetworkRequest /notebook\/new/, 'get'

    # Automatically decode JSON responses
    id = @browser.getRequestResponses(/notebook\/new/)[0].id

    # ... do something

    @browser.assert.hasNetworkRequest /notebook\/update/, 'put'

    putBody = @browser.getRequestBodies(/notebook\/update/)[0]
    assert putBody.id is id

A current partial solution is to use one of the evaluate methods and extract the stored ID, but it isn't unreasonable to assume that the stored ID is in a closure variable which isn't accessible from the global scope.

remove js, but publish sourcemaps

  • remove the /lib directory from the repository
  • set up source maps such that compiled and published /lib JavaScript points back to the /src CoffeeScript

This may be easier if we just switch to CoffeeScript (away from CoffeeScriptRedux).

Chrome Warning: “You are using an unsupported command-line flag –ignore-certificate-errors. Stability and security will suffer.”

Testium uses chromedriver to connect to Chrome, which starts Chrome with the flag –ignore-certificate-errors by default. A somewhat recent version of Chrome added this flag to the list of "bad flags", which causes a warning banner to show up when you start the browser.

Supposedly, you can fix this by either adding "--test-type" to the args or by adding excludeSwitches="ignore-certificate-errors" to the chromeOptions capabilities object. Neither fixes the problem for me, but many report that both will work.

We need to find a way to make this banner not show up.

Running app and tests in the same process

Sorry if this is the wrong place for feature requests, I'll gladly post elsewhere if it's more helpful.

I was wondering why Testium's testium.run() method spawns the test files in a new process, rather than running them in the same process. The reason Testium looks so promising is that, being based on Node, it could let one run one's app and tests in the same process, so one could stub out internal APIs while running web interaction tests.

However, my attempts to do this have been fruitless: booting my app from the test files resulted in the Testium proxy not calling through to the app, and booting the app in my test.js script before calling testium.run() means I cannot stub things during tests, since they run in another process. It took me a while to figure out this was the cause of my internal API calls not affecting the running app at all.

Are there any plans to change this behaviour, or can it already be changed?

Provide test generator

Would be nice to have a generator of some sort that makes bridging the gap between the CLI environment and running tests a bit easier.

After hacking around in the CLI my next step was to try to write similar procedural tests rather than create individual test cases but kept hitting error cases due to missing parameters, etc. when attempting to use getBrowser outside of a run test context.

Would also be nice if this generator generated code in both coffeescript and javascript for us ludites.

Proposing `ElementHasAttributes` assertion.

Hello,

I am proposing just a wrapper function browser.assert.elementHasAttributes, something of this sort :

assert = require('assertive')
{some, isEmpty} = require('underscore')

elementHasAttributes = (browser = null, selector = '', attributes = {}) ->
    return null if some arguments, isEmpty
    element = browser.getElement(selector)
    assert.expect(element)
    for key,val of attributes
      assert.expect (element.get(key)==val)

I use it when I need to test various properties of an element in one go. Thought might be helpful.

Thanks,
Parag

Add a built-in wait

Testium obviously already has some concept of waiting (waitForElement, etc), it seems like we should expose that interface to make it easier to test behaviors with intricate timing.

Firefox browser.evaluate hangs

I'm running a simple evaluate function to simulate mouseover but it results in error on firefox. I've tried Firefox 27, 26, and 24 & Java 1.6.0_35 and 1.8.0_25 & testium 1.10.1. Both Chrome and phantomjs run fine. Any thoughts why this is happening?

@browser.evaluate -> $('#review-star-5').mouseover()

Error output:

Error grabbing screenshot: Modal dialog present: A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

Script: file:///var/folders/mv/6d0zmn4s2278qjsb668ny1n4lcsm3y/T/anonymous189260385991081576webdriver-profile/extensions/[email protected]/components/driver_component.js:7458
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'C02J823BDKQ4.group.on', ip: '10.101.115.64', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.2', java.version: '1.8.0_25'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=24.0, platform=MAC, browserConnectionEnabled=true, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 726f7293-ddc3-7543-8fa3-0afc4df8df81

waitForElementVisible should look for the `hidden` attribute

waitForElementVisible and other visibility-related methods appears to only be looking at display:none to test for visibility, but doesn't appear to check for the more semantic HTML5 hidden attribute.

Would be cool to see it include that as part of the visibility test.

provide a javascript console as well

The current console ./node_modules/.bin/testium runs coffee-script-redux. Provide an option to run this in JavaScript mode.

Possibly: ./node_modules/.bin/testium --javascript

doesn't deal with multibyte unicode characters

testium does not deal with multibyte unicode characters.

// LICENSE : MIT
"use strict";
var assert = require("assert");
var injectBrowser = require('testium/mocha');
describe("multi byte char", function () {
    before(injectBrowser());
    beforeEach(function () {
        this.browser.navigateTo('https://www.google.com');
    });
    it('should type to textarea', function () {
        var multiByteText = "日本語 text";
        var input = this.browser.getElement('input[name="q"]');
        input.type(multiByteText);
        // garbled characters
        assert.equal(input.get("value"), multiByteText);
    });
});

Result:

$ npm test

> [email protected] test /Users/azu/.ghq/github.com/azu/testium-multibyte-bug
> mocha test/



  multi byte char
    1) should type to textarea


  0 passing (2s)
  1 failing

  1) multi byte char should type to textarea:
     AssertionError: "�,� text" == "日本語 text"
[TESTIUM] Saved screenshot /Users/azu/.ghq/github.com/azu/testium-multibyte-bug/test/log/failed_screenshots/multi_byte_char_should_type_to_textarea4.png
      at Context.<anonymous> (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/test/test.js:14:16)
      at callFn (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runnable.js:251:21)
      at Test.Runnable.run (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runnable.js:244:7)
      at Runner.runTest (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runner.js:374:10)
      at /Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runner.js:452:12
      at next (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runner.js:299:14)
      at /Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runner.js:309:7
      at next (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runner.js:248:23)
      at /Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runner.js:271:7
      at done (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runnable.js:207:5)
      at callFn (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runnable.js:262:7)
      at Hook.Runnable.run (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runnable.js:244:7)
      at next (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runner.js:259:10)
      at Object._onImmediate (/Users/azu/.ghq/github.com/azu/testium-multibyte-bug/node_modules/mocha/lib/runner.js:276:5)
      at processImmediate [as _immediateCallback] (timers.js:345:15)

failed_screenshots:

screen-shot

FYI: request-sync is deprecated, use sync-request

testium doesn't work as a global install

$ npm install -g testium
...
$ testium 
Preparing phantomjs...

/home/smassa/.nvm/v0.10.36/lib/node_modules/testium/lib/cli/console.js:112
      throw error;
            ^
Error: ENOTDIR, mkdir '/usr/bin/test/log'

Should we make sure it works globally? If not, we should at least throw an error and document that it only works locally.

Fails to set cookies on firefox before loading a page

Error message:

1) My favorite test "before all" hook:
     Error: You may only set cookies on html documents
Command duration or timeout: 18 milliseconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'some-fancy-host-name', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.2', java.version: '1.7.0_51'
Session ID: d9ffc20d-0006-5943-a01d-77654020899e
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, browserConnectionEnabled=true, webStorageEnabled=true, nativeEvents=false, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=false, takesScreenshot=true, version=28.0}]

Test (roughly):

describe 'My favorite test', ->
  before ->
    @browser = getBrowser()
    @browser.setCookie name: 'super-secret', value: 'hunter2'
    @browser.navigateTo '/'

  it 'works in phantom but not in firefox', ->

The usual workaround of loading the page first and then setting the cookie works.

[Solved] Cannot install 1.4.0 or 1.4.1

I cannot install [email protected] or [email protected]: (note that [email protected] works fine)

$ npm init
...
$ npm install --save [email protected]
...
npm http 304 http://npm-registry.snc1/sntp
npm http 304 http://npm-registry.snc1/boom
npm http 304 http://npm-registry.snc1/cryptiles
npm http 304 http://npm-registry.snc1/hoek

> [email protected] install /Users/jtelford/dev/tmp/node_modules/testium/node_modules/img-diff/node_modules/png
> node-gyp rebuild

  CXX(target) Release/obj.target/png/src/common.o
  CXX(target) Release/obj.target/png/src/png_encoder.o
  CXX(target) Release/obj.target/png/src/png.o
  CXX(target) Release/obj.target/png/src/fixed_png_stack.o
  CXX(target) Release/obj.target/png/src/dynamic_png_stack.o
  CXX(target) Release/obj.target/png/src/module.o
  CXX(target) Release/obj.target/png/src/buffer_compat.o
  SOLINK_MODULE(target) Release/png.node
  SOLINK_MODULE(target) Release/png.node: Finished
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/jtelford/dev/tmp/npm-debug.log
npm ERR! not ok code 0

The additional details:

$ tail -n25 /Users/jtelford/dev/tmp/npm-debug.log
1906 silly lockFile c21e0cdb-node-modules-webdriver-http-sync tar:///Users/jtelford/dev/tmp/node_modules/testium/node_modules/webdriver-http-sync
1907 silly lockFile 53b48531-iver-http-sync-0-7-1-package-tgz tar:///Users/jtelford/.npm/webdriver-http-sync/0.7.1/package.tgz
1908 silly lockFile 53b48531-iver-http-sync-0-7-1-package-tgz tar:///Users/jtelford/.npm/webdriver-http-sync/0.7.1/package.tgz
1909 silly gunzTarPerm extractEntry lang/zh-tw.js
1910 info /Users/jtelford/dev/tmp/node_modules/testium/node_modules/webdriver-http-sync unbuild
1911 verbose read json /Users/jtelford/dev/tmp/node_modules/testium/node_modules/webdriver-http-sync/package.json
1912 error Error: ENOENT, lstat '/Users/jtelford/dev/tmp/node_modules/testium/node_modules/mocha/lib/suite.js'
1913 error If you need help, you may report this log at:
1913 error     <http://github.com/isaacs/npm/issues>
1913 error or email it to:
1913 error     <[email protected]>
1914 error System Darwin 12.4.0
1915 error command "/Users/jtelford/.nvm/v0.8.26/bin/node" "/Users/jtelford/.nvm/v0.8.26/bin/npm" "install" "--save" "testium"
1916 error cwd /Users/jtelford/dev/tmp
1917 error node -v v0.8.26
1918 error npm -v 1.2.30
1919 error path /Users/jtelford/dev/tmp/node_modules/testium/node_modules/mocha/lib/suite.js
1920 error fstream_path /Users/jtelford/dev/tmp/node_modules/testium/node_modules/mocha/lib/suite.js
1921 error fstream_type File
1922 error fstream_class FileWriter
1923 error code ENOENT
1924 error errno 34
1925 error fstream_stack /Users/jtelford/.nvm/v0.8.26/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
1925 error fstream_stack Object.oncomplete (fs.js:297:15)
1926 verbose exit [ 34, true ]

Right way to use debugger to debug test failures

Problem: getting a 404, expecting a 200. Want to use node-inspector to debug the app that tests are running against.

What's the right way to go about this?

Dear People from the Future, here's what we figured out so far.

  1. run node-inspector and connect to debugger in Chrome/whatever using the URL echoed by node-inspector
  2. set launch = false in .testiumrc
  3. Specify constant port number via app.port in .testiumrc OR export PORT=something
  4. add debugger statement in production code
  5. run your app with node --debug-brk app.js or the equivalent of what npm start does for you with --debug-brk argument passed to node
  6. run tests as normal (not under debugger)

Gotchas: don't simultaneously run your app under the debugger and your unit tests under the debugger. Bad things will happen.

About to try this out, but would appreciate any other advice on how to debug our app under test. 🍻

Improve documentation on initial setup

In the readme file, the whole listing of options available is useful but it's hard to figure out what is actually need and what is not. Also it's not clear on what is environmental vs. not and external vs. not.

For me the ideal would be "here is the minimum you need to run. You might need to change this port parameter if you have a conflict with your local environment."

Feedback about document

Hi! Thanks for nice tools ✨
I started to use testium, then I had a couple suggestion.

(My English is not good but hope you understand me...)

1. minimum setup

To work testium took a little longer than I anticipated.
I suggest that prepare officially minimum setup example. (something like jkrems/testium2-demo)

I'v created azu/testium-seed which is a example of minimum setup.

I have wanted to get a example which is actually work.

2. copy/pastable configuration

The Configuration not seem to be copy/pastable.

At first, I pasted the Configuration to .testiumrc and it didn't work.

I was confused.
2015-01-20_15-32-02
(and error message not have much meaning for me...)

I suggest that Configuration is better to be copy/pastable.

Related PR: #123

3. Don't Ignore Errors

The .testiumrc should be error, but only ignore error.

; .testiumrc
launch : true

The .testiumrc should be parse error and output error like follwonig:

launch : true
        ^ Error: Line 2: Unexpected token :

4. Missing wiki?

For help debugging your tests, check out the wiki page.
-- README.md

https://github.com/groupon/testium/wiki/Debugging-Your-Tests is 301.


Maybe these are not actual issue.

Thanks.

Q: is it possible to speed up `navigateTo()` or `refresh()` ?

We have tests in LS where we have to change cookie setting and/or change url parameters. These tests take roughly 2200ms each.

Do these navigateTo() and refresh() methods clear the cache when loading the page? If so is there a way to avoid clearing the cache to speed up the tests?

Appium support

First of all I really want to thank you for the great work on Testium. I've been playing around with selenium and modules which base on it for some time now. But Testium is really looking promising for me. I like the synchronous api - no callback-hell, no promises.
Another interesting module is grunt-mocha-selenium. It behaves in some points similar to testium, besides the asynchronous API. But the most interesting feature is the integration of Appium. Appium is

[...] an open source test automation framework for use with native and hybrid mobile apps.
It drives iOS and Android apps using the WebDriver JSON wire protocol.

So you can write ui tests once and use them for mobile and desktop browsers.

I was wondering if an integration of Appium in Testium could be also interesting for you?

Q: how do can you log stuff when in tests

Is there a neat way to log (like console.log() ) informatinon within a test?
It would be quite handy to check what value variables or statements have to find errors when constructing test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.