Git Product home page Git Product logo

astrolabe's People

Contributors

carolinebda avatar chriscantu avatar droogans avatar klamping avatar shradds avatar stuplum avatar yj04jls 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

astrolabe's Issues

Less verbose api

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 
};

Astrolabe and protractor 2.0

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.

How to do drag and drop

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();

}

Protractor 24.1 updates.

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.

Questions about Usage

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?

Annotated Source Code

Myself and @chriscantu have been studying the following files/lines, and have found difficulty determining what they do:

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.

How to test page objects from node console

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?

How to get item by index from findElements?

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.

Feature Request: Ability to create reusable modules for common ui componets

In Geb, one has the ability to create reusable modules for components that are repeated on many pages.

From their documentation:

  • Modules are re-usable definitions of content that can be used across multiple pages. They are useful for modelling things like UI widgets that are used across multiple pages, or even for defining more complex UI elements in the one page.

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?

Page.go ought to return a Promise

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.

Explicit waits in page objects

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);
  });
});

Feature Request: Mocha Integration

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

Get vs Value

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

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.