Protractor if else with expect(condition)

Protractor if else with expect(condition)

In my script, I need to include if-else condition to verify whether the expected=actual.If they are not matching it should go to the else block and print "StepFailed".But, always its executing the if block and the o/p is "step passed" although expected≠Actual.Below is my code:

In my script, I need to include if-else condition to verify whether the expected=actual.If they are not matching it should go to the else block and print "StepFailed".But, always its executing the if block and the o/p is "step passed" although expected≠Actual.Below is my code:

   var expected = ['Select training program using Index', 'Selenium', 
                   'A','UFT/QTP','Loadrunner'];
   var els = element.all(by.xpath("//select[@id='dropdown1']/option"));

for (var i = 0; i < expected.length; ++i) { if(expect(els.get(i).getText()).to.eventually.equals(expected[i])){ console.log('' +'Steppassed'+ ''); } else { console.log('' +'Stepfailed'+ ''); } }

Drop down values are:'Select training program using Index', 'Selenium', 'Appium','UFT/QTP','Loadrunner'.If you would have observed I have given 'A' instead of "Appium' and hence the step should fail but that's not happening.

kindly suggest me how this can be resolved.Thank you.

typescript npm

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to publish Typescript Package to NPM

Learn how to publish a module written with TypeScript to NPM

Creating CommonJS-based Npm Packages via TypeScript

This blog post describes how to use TypeScript to create npm packages with CommonJS modules. All the artifacts that are shown can be downloaded via the GitHub repository ts-demo-npm-cjs (I deliberately have not published it to npm).

NPM Install and NPM CI: In What Aspect They Differ

Nodejs web development has achieved such a huge acclamation all over the world just because of its large ecosystem of libraries known as NPM modules. The npm ci (continuous integration) installs dependencies from package-lock.json directly and use up package.json just to verify that there are no mismatched versions exists.

#7: What exactly is NPM module? - Mastering NPM

Let's learn more about NPM and how it works. #7: What exactly is NPM module? - Mastering NPM

#8: npm install Working - Mastering NPM

#8: npm install Working - Mastering NPM