Cucumber Multiple Choice Answers – MCQ1

HOME




@LoginPage
Feature: Login to HRM Application
  
   @ValidCredentials
   Scenario: Login with valid credentials
     
   Given User is on HRMLogin page "https://opensource-demo.orangehrmlive.com/"
    When User enters username as "Admin" and password as "admin123"
    Then User should be able to login successfully and new page open

import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
 
@RunWith(Cucumber.class)
@CucumberOptions(plugin = "pretty", features = "src/test/resources/Features/MyHoliday.feature", tags = "@BookOneWayFlight")
 
public class CucumberRunnerTest {
 
}










Feature: Login to HRM Application
 
  Background:
    Given User is on HRMLogin page "https://opensource-demo.orangehrmlive.com/"
 
  @ValidCredentials
  Scenario: Login with valid credentials
 
    When User enters username as "Admin" and password as "admin123"
    Then User should be able to login successfully and new page open
 
  @MissingUsername
  Scenario: Login with blank username
 
    When User enters username as " " and password as "admin123"
    Then User should be able to see a message "Required" below Username










Leave a comment