From 8a80d2463500d95adc6801ef84f0ac42f0814fb1 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Thu, 11 May 2017 11:28:44 +0200 Subject: [PATCH] Fix all warnings in e2e tests --- src/spec/spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spec/spec.js b/src/spec/spec.js index 3ba46b55b..92100d2f6 100644 --- a/src/spec/spec.js +++ b/src/spec/spec.js @@ -31,13 +31,13 @@ const EC = protractor.ExpectedConditions; const waitTime = 5000; function waitForElemAndCheckItsText(selector, text) { - const elem = element(by.css(selector)); + const elem = element.all(by.css(selector)).get(0); browser.wait(EC.presenceOf(elem), waitTime, `waiting for element '${selector}'`); expect(elem.getText()).toEqual(text, `inside element "${selector}"`); } function waitForElemAndClickIt(selector) { - const elem = element(by.css(selector)); + const elem = element.all(by.css(selector)).get(0); browser.wait(EC.presenceOf(elem), waitTime, `waiting for element '${selector}'`); elem.click(); } @@ -328,9 +328,9 @@ function testVoteFromDialog() { waitForElemAndClickIt('delegates tr:nth-child(3) md-checkbox'); waitForElemAndClickIt('delegates tr:nth-child(3) md-checkbox'); element.all(by.css('delegates md-card-title button.vote-button')).last().click(); - element(by.css('md-autocomplete-wrap input')).sendKeys('genesis_7'); + element.all(by.css('md-autocomplete-wrap input')).get(0).sendKeys('genesis_7'); waitForElemAndClickIt('md-autocomplete-parent-scope'); - element(by.css('md-autocomplete-wrap input')).sendKeys('genesis_7'); + element.all(by.css('md-autocomplete-wrap input')).get(0).sendKeys('genesis_7'); waitForElemAndClickIt('md-autocomplete-parent-scope'); waitForElemAndClickIt('vote md-dialog-actions button.md-primary'); waitForElemAndCheckItsText('md-toast', 'Voting successful');