Skip to content

Commit

Permalink
Add test with multiple commas in uiautomator code (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
imurchie authored Jul 10, 2018
1 parent df6115c commit ed4f9fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/functional/commands/find/by-uiautomator-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ describe('Find - uiautomator', function () {
let el = await driver.findElement('-android uiautomator', selector);
await driver.getText(el.ELEMENT).should.eventually.equal('Views');
});
it('should parse commas in quotes correctly', async function () {
// two commas could mess with the parsing
let selector = 'new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().text("One thing, another thing, and yet a third.").instance(0));';
await driver.findElement('-android uiautomator', selector)
.should.eventually.be.rejectedWith(/An element could not be located/);
});
it('should error reasonably if a UiScrollable does not return a UiObject', async function () {
let selector = 'new UiScrollable(new UiSelector().scrollable(true).instance(0)).setMaxSearchSwipes(10)';
await driver.findElement('-android uiautomator', selector)
Expand Down

0 comments on commit ed4f9fa

Please sign in to comment.