Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Protractor Testing Guidance #270

Open
JustinDSN opened this issue Oct 7, 2014 · 5 comments
Open

Protractor Testing Guidance #270

JustinDSN opened this issue Oct 7, 2014 · 5 comments

Comments

@JustinDSN
Copy link

Any guidance on how to best test this directive with a Protractor end-to-end test? I tried to add an id attribute to the ui-select directive but it was replaced by the directive's replaced template.

@dimirc dimirc added this to the 0.10.x milestone Oct 7, 2014
@dimirc
Copy link
Contributor

dimirc commented Oct 7, 2014

Currently the id attribute isn't passed. Honestly I haven't use protractor so I'm not sure if the id is all needed

@keithharvey
Copy link

Using the outside container class ('type', but this could easily be an id)

it "selects a type", ->
    element(by.css(".type button")).click()
    element(by.linkText("Product")).click()

@awerlang
Copy link
Contributor

var selectButton = element(by.name('fieldName'));
var selectInput = selectButton.element(by.css('.ui-select-search'));

// click to open select
selectButton.click();
// type some text
selectInput.sendKeys('Person name');
// select first element
element.all(by.css('.ui-select-choices-row-inner span')).first().click();

Tip: wrap into a page object to make things easier

@rfodge
Copy link

rfodge commented Oct 2, 2015

Did anyone have issues with protractor waiting for these elements to load? We have to add browser.sleep() in because it doesn't wait for these elements, which angular components protractor normally does by default.

@BjoernKW
Copy link

I'm having problems with Select2 and Protractor as well. Select2's behaviour with Protractor seems rather unpredictable when filtering and selecting elements. Sometimes elements will be selected, sometimes not. The only way to enforce consistent behaviour right now appears to be using browser.sleep(), which is a rather ugly hack and unnecessarily slows down tests.

@wesleycho wesleycho removed this from the 0.10.x milestone Mar 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants