Giter VIP home page Giter VIP logo

dalek-internal-assertions's People

Contributors

arian avatar asciidisco avatar bitdeli-chef avatar fhemberger avatar mischah avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

arian

dalek-internal-assertions's Issues

Assert hangs if element does not exist

Certain assertions will just hang indefinitely if the selector does not return a element. Certain asserts work fine with a selector returning no elements like exists() and doesntExist however 2 that hang that I have tested are attr() and text().

Add to.match() test helper

The to.contain() test helper helps with a lot of cases where the value is dynamic and you can't know what the exact value with be (as it might change) however there is still some cases where to.contain() will not work.

I think adding a to.match() test helper that uses regular expressions will help fill in that gap. This will give the user the ultimate power in making sure a certain value match and certain structure.

I will work on this feature.

Ability to set the amount of time to wait when using asserts

While my specific use case related to doesntExist, I can't see any reason not to expose this functionality to all assert methods.

Right now when using assert.doesntExist(), it seems to wait a few seconds before it either passes of fails the test but there is no control over what the wait time is. I think the default wait time should be instant 0 milliseconds) but allow the user to be able to override that.

The use case for me is I have this component that will wait X milliseconds after the user has stops typing before performing an ajax request and insert that data from the ajax request. If that time is set to 350 milliseconds, right now I can't test that because doing this:

test.assert.doesntExist('selector')

will wait more that 350 milliseconds. What would be nice is to be able to do something like this:

test
  //should not exists yet, only 200 milliseconds passed
  .assert.wait(200).doesntExist('selector')
  //not it should exists as 400 milliseconds has passed, more than the configured 350 milliseconds)
  .assert.wait(200).exists('selector');

Can't select new window / tab

I'm getting an issue where I can't select a new tab that opens up via toWindow() function. If I have an anchor that has target="_blank", how do I select that new tab? Everything I try just makes DalekJS freeze up.

Assertions on results of method execution

It would be nice if there would be assertions that let you execute a js on the page and asserts the return value with a value to check if the js works correctly.

allow to use assertion / step groups

I ๐Ÿ˜ Dalek's API.

One thing that'd I'd like to do is this:

test.open( url ).assert( userIsSignedOut ).done()

function userIsSignedOut() {
  this.assert.chain()
    .visible('.accountBar')
    .text('.username', '')
  .end()
}

That would allow me to define reusable steps / assertion groups. I'd like to have the same for steps, like so

test.open( url ).then( takeScreenshots ).done()

function takeScreenshots() {
    this.resize({width: 320, height: 480})
    this.screenshot('/screenshots/:viewport')
    this.resize({width: 768, height: 1024})
    this.screenshot('/screenshots/:viewport')
    this.resize({width: 1280, height: 800})
    this.screenshot('/screenshots/:viewport')
    this.resize({width: 1680, height: 1050})
    this.screenshot('/screenshots/:viewport')
}

This would make the actual test files very consize and even more readable, at the same time allow for better code reuse. Happy to help building this if you like it

Ability to do contains assertion

Right now we can do something like:

assert.attr('selector', 'class').is('class1 class2 class3', 'has class2');

but it would be much better to be able to do (and it would also allow other things that are currently impossible):

assert.attr('selector', 'class').contains('class2', 'has class2');

.attr() does not work properly, potential bug

i have an html element like this:

<input id="blub" class="ember-view ember-text-field form-control" placeholder="-" disabled="disabled" type="text" data-testid="foo">

I want to assert the disabled attribute as it is described in the docs with:

.attr('[data-testid="foo"]').is('disabled', 'disabled', 'Textfield blub is disabled.')

but it fails saying:
-->0 EXPECTED: disabled
-->0 FOUND: null
-->0 MESSAGE: disabled

Any ideas?

versions:
Win7
dalek-cli 0.0.4
dalekjs local install: 0.0.8

cheers izocan

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.