1

I am trying to run my e2e tests in docker image via circle ci.

Out of 7 tests, 6 tests are failing and 1 test is passing. But when I ran them locally all tests are passing.

This is the error I am getting

✗ Should Display Dashboard Header and Loan Information
      - Failed: No element found using locator: By(css selector, h3[class="sprk-b-TypeDisplayFour sprk-o-Stack__item sprk-u-Color--white"])
          at elementArrayFinder.getWebElements.then (/home/circleci/project/node_modules/protractor/built/element.js:814:27)
          at ManagedPromise.invokeCallback_ (/home/circleci/project/node_modules/selenium-webdriver/lib/promise.js:1376:14)
          at TaskQueue.execute_ (/home/circleci/project/node_modules/selenium-webdriver/lib/promise.js:3084:14)
          at TaskQueue.executeNext_ (/home/circleci/project/node_modules/selenium-webdriver/lib/promise.js:3067:27)
          at asyncRun (/home/circleci/project/node_modules/selenium-webdriver/lib/promise.js:2927:27)
          at /home/circleci/project/node_modules/selenium-webdriver/lib/promise.js:668:7
          at <anonymous>
          at process._tickCallback (internal/process/next_tick.js:189:7)Error
          at ElementArrayFinder.applyAction_ (/home/circleci/project/node_modules/protractor/built/element.js:459:27)
          at ElementArrayFinder.(anonymous function).args [as getText] (/home/circleci/project/node_modules/protractor/built/element.js:91:29)
          at ElementFinder.(anonymous function).args [as getText] (/home/circleci/project/node_modules/protractor/built/element.js:831:22)
          at Dashboard.getDashboardHeaderText (/home/circleci/project/e2e/app/loan/dashboard/dashboard.po.ts:47:41)
          at Object.<anonymous> (/home/circleci/project/e2e/app/loan/dashboard/dashboard.e2e-spec.ts:18:30)
          at step (/home/circleci/project/node_modules/tslib/tslib.js:133:27)
          at Object.next (/home/circleci/project/node_modules/tslib/tslib.js:114:57)
          at /home/circleci/project/node_modules/tslib/tslib.js:107:75
          at new Promise (<anonymous>)
          at Object.__awaiter (/home/circleci/project/node_modules/tslib/tslib.js:103:16)
      From: Task: Run it("Should Display Dashboard Header and Loan Information") in control flow
          at UserContext.<anonymous> (/home/circleci/project/node_modules/jasminewd2/index.js:94:19)
          at 

all other tests are also failing with the same error element not found.

enter image description here

  • With such little information, there's not much we can do for you. Have you got screenshots/videos/HTML dumps from the container? Done any debugging? – jonrsharpe May 02 '19 at 21:58
  • I think it might help to share your Dockerfile. How you are running Protractor (is it a selenium grid?, are you just using a selenium server, etc)? What tests fail? Are your docker instances really slow that the timeout is reached? – cnishina May 03 '19 at 00:36
  • It may be that element is not loaded so you need to disable waitForAngular and add some sleep - that's my wild guess. It may happen when locally Protractor recognize your application as Angular app but doesn't for deployed one. However, your question needs more details with your implementation. – Justinas Jakavonis May 08 '19 at 20:57
  • use thread.sleep(20000) after your elements and see if its working, if it does you will need to implement some robust waits – Batistuta Chand Jul 06 '20 at 20:51

0 Answers0