Posts

Showing posts with the label gherkin

Cypress, Cucumber/Gherkin

Image
 To use cypress, we need to use Visual Studio code IDE. Create new folder in the repo folder: VS code > open folder > find the just created folder Terminal > New terminal To initialise project: Just press enter. If all ok, type in yes. Installing cypress To install with specific version, add @^xx.x.x To open cypress: Click E2E testing: Once the initial configuration is completed, go back to VS code. Cypress > add a new folder within the cypress folder and name it "integration". Within integration folder, create a new javascript file (.js extension) To let Cypress know where it can find out tests, go to cypress config js file and type below command and save:  Cypress will recognise all js file in integration folder as Tests. Then write the test in the js file. Sample: Save and run in the cypress browser. To find an element via cypress, click on the locator button and then the specific element that we want. From there you can just copy the code that has been prepare...

Specflow, Gherkin

Image
 Specflow is a BDD framework - purpose of using Specflow is when you want to apply BDD methodology (because Selenium is not enough to implement BDD) BDD Behavior-driven development (BDD) is an agile software development methodology that  focuses on collaboration and communication between developers, testers, and business stakeholders Selenium is also a framework NUnit is also a framework In feature file part, will use Gherkin syntax to write test case (will only include human language test case) Step definition will bridge the human language with the code To use Specflow, need to install below NuGet packages Creating a feature file: Folder > Add > New Item > Specflow The tag can be used to tag the test case. Example, @positive / @smoke / @regression etc What is Gherkin ? Given, When, Then - These are Gherkin syntax Creating the step definition: