dalekjs / dalek-internal-webdriver Goto Github PK
View Code? Open in Web Editor NEW[unmaintained] Webdriver bindings for DalekJS
License: MIT License
[unmaintained] Webdriver bindings for DalekJS
License: MIT License
Let's say we run an assert.exists
with an invalid selector such as:
.assert.exists('h1:contains("FOoooooooooooooo")','LIAR!!!!!!!!')
The Webdriver response is pretty clear that there has been an error, but Dalek still things it succeeded:
☁ [WEBDRIVER] webdriver: 200 POST /session/5600592b61bb652f2f6175d96484529c/element
☁ [WEBDRIVER] webdriver: {"sessionId":"5600592b61bb652f2f6175d96484529c","status":12,"value":{"message":"invalid element state: Failed to execute 'querySelector' on 'Document': 'h1:contains(\"FOoooooooooooooo\")' is not a valid selector.\n (Session info: chrome=36.0.1985.125)\n (Driver info: chromedriver=2.9.248307,platform=Mac OS X 10.9.3 x86_64)"}}
✔ EXISTS LIAR!!!!!!!!
Now from what I remember type() is intentionally clearing the input because of an issue with FireFox and placeholder text however doing so make it impossible to test certain functionality.
For example, one of my test cases might be to type something into input and then wait for an element to appear that is ajax driven. Then I want to type the back space and make sure that ajax driven element goes away but the code has a delay between the last character being type and the ajax request going out. Now if I type the text and back space together with one call to .type() (and since it clears out the text with each call to .type(), I have to), the element that is ajax driven would have never been added to the DOM so I can test that it was properly removed.
Ultimately the question is whether to support FireFox while it has this bug and not be able to test everything or be able to test everything or not support FireFox until they fix there bug but be able to test everything. For my use case, I prefer the second option as I am using DalekJS as more of "unit test" like tests for the UI (all ajax requests are being mocked) instead of a replacement for Selenium (mainly because I don't think DalekJS can act as a replacement for selenium, at least not yet).
In order to be able to integrate DalekJS more closely with 3rd party libraries/framework (the ability to create framework specific functionality which would be especially useful for MV* frameworks) it should be possible to gain access to the window/document object (for both actions and assertions). For example the Angular object is attached to the document of the page so if we had access to that, we could do AngularJS specific things.
Since I don't have a lot of experience working with the JSON Wire Protocol, I am not 100% sure if this is possible although I know the Protractor (https://github.com/angular/protractor) does this and it uses selenium's webdriverjs under the hood (which uses the JSON Wire Protocol).
it because lib/driver.js ·var msg = JSON.parse(data.value.message);· IE when element cann't be click send 500 error and message is just a string not a json.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.