stuplum / astrolabe Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
I'm not sure why it does so.
My team is thinking about writing something similar, but with a less verbose api. I was wondering what people think of an api like this:
// ./page-objects/sign-in.js
var al = require('astrolabe');
module.exports = {
userName: al.model('username'),
password: al.model('password'),
signIn: al.css('.sign-in'),
navigation: require('./tabs-not-signed-in); // another page-objects
};
Are there any known issues with astrolabe and protractor 2.0?
The reason I ask is because I am trying to upgrade to protractor 2.0 and when I run my tests they all fail and the browser seem to lag behind. For example I have about 20 tests and they will all fail immediately, but when I look at the actual browser it it still going through the test cases.
it works fine in protractor 1.8.0.
The built url is then wrong with two consecutive '//'.
Hi All,
I am using astrolabe to automate my angular js webpage.
i am using the below code for the drag and drop, and its not working.
one question is how do we call actions.dragAndDrop from the page object.
please help me to resolve.
Thanks in advance.
Uma
drag1: { get: function() { return this.findElement(this.by.repeater('unmapped in unmappedFields').row(2)); } },
drop1: { get: function() { return this.findElement(this.by.id('targetList')); } },
addClientObject: { value: function(objname) {
var page = this;
page.go();
page.addcliobjbtn.click();
page.cobjname.sendKeys(objname);
browser.actions().dragAndDrop(page.drag1, page.drop1).perform();
page.objsave.click();
}
Astrolabe uses Selenium's raw findElement
, which return WebElement
objects.
Protractor 24.1 introduces a new ElementFinder
object, which behaves differently.
Astrolabe should support both, but prefer the new ElementFinder
type by default.
As of this writing, they are still polishing the final implementation, so action isn't needed at this time.
Hello, I was a bit confused on how to write custom methods works in astrolabe. My understanding is that all properties of the page must be an object. Each of these obj specifies a get
or value
property. What is the difference and when should I use which? Are there other properties we should know about?
Also, the keyword this
seems to Page when inside of a value/get method correct?
Myself and @chriscantu have been studying the following files/lines, and have found difficulty determining what they do:
extend
method (this is by far most important one)module
in the top-level astrolabe object
If you could provide an annotated form of these files, we'd be able to better contribute to the project. We feel we have a pretty good idea of what they probably do, but we can't determine any hard facts or details without help.
Thanks in advance.
Yo yo,
I'm trying to use pageObjects directly in node console. This is the steps that I'm doing:
Starting selenium server on http://localhost:4444/wd/hub
$ webdriver-manager start
And in the new terminal:
$ node
> var page = require('path/to/astro/page/object');
> page.go();
This blows up because context is not initialized. What am I missing?
header_PersonName: { get: function() { return this.findElements(this.by.binding('{{header.displayName}}')).then(function (elems) {
return elems[0];
}); } }
My test:
expect(page.header_PersonName).toBeDefined();
When I run protractor I get this error:
Error: expect called with WebElement argment, expected a Promise. Did you mean to use .getText()?
Thanks for any help.
Currently there is no Locator strategy for cssContainingText. I have added it the PR for it is here #23
In Geb, one has the ability to create reusable modules for components that are repeated on many pages.
From their documentation:
I wasn't sure of the best approach how to do this with Astrolabe. At present, all I can figure out is to create a separate module with methods which will find the elements. I wasn't able to use the get
syntax in the library.
Suggestions?
The method it wraps, browser.get
, returns a Promise
(though undocumented). I find myself needing this quite often, e.g. doing browser.pause()
following a page load.
How would you perform an explicit wait inside your page object, the example would be to create a login function in the page object which would do all of the following:
ptor.driver.findElement(protractor.By.id('username')).sendKeys('Jane');
ptor.driver.findElement(protractor.By.id('password')).sendKeys('1234');
ptor.driver.findElement(protractor.By.id('clickme')).click();
// Login takes some time, so wait until it's done.
// For the test app's login, we know it's done when it redirects to
// index.html.
ptor.wait(function() {
return ptor.driver.getCurrentUrl().then(function(url) {
return /index/.test(url);
});
});
Hello, I would very much like to use astrolabe with mochajs. I have tried to get it to run with grunt-mocha-protractor with no success. When I run my tests, I get 'this' is undefined in the Astrolabe pages I created.
TypeError: Cannot call method 'findElement' of undefined
Any suggestions?
Many thanks in advance
Chris
Sorry if this is answered somewhere in the docs, but I didn't see it.
What is the difference between the get: and value: ?
I pulled this from your own code
https://github.com/stuplum/astrolabe/blob/master/lib/astrolabe/page.js
debug: { value: function() { this.context.debugger(); } },
title: { get: function() { return this.context.getTitle(); } },
https://github.com/stuplum/astrolabe/blob/master/lib/astrolabe/base.js
by: { value: protractor.By },
driver: { get: function() { return browser; } },
exception: { value: function(name) { return new exceptions.Exception(name); } },
findElement: { value: function(by) { return this.context.findElement(by); } },
findElements: { value: function(by) { return this.context.findElements(by); } },
I don't see any consistent difference between their usage
This is because chai
was recently upgraded to 2.x.x
.
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package chai does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants chai@>=1.0.0 <2
package.json entry should say BSD-3-Clause
(see https://npm.im/astrolabe and click on the BSD link to see what it currently points to)
Can't access module wjen the selector is findElements e.g.
return myModule( this.findElements( this.by.css('tr') ) ); }
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.