This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arun.cucumber.hello.bdd; | |
import cucumber.api.junit.Cucumber; | |
import java.io.File; | |
import java.util.ArrayList; | |
import java.util.List; | |
import net.masterthought.cucumber.Configuration; | |
import net.masterthought.cucumber.ReportBuilder; | |
import org.junit.runner.notification.RunNotifier; | |
import org.junit.runners.model.InitializationError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arun.cucumber.hello.bdd; | |
import static java.util.Locale.ENGLISH; | |
import com.fasterxml.jackson.databind.DeserializationFeature; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.SerializationFeature; | |
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | |
import cucumber.api.TypeRegistryConfigurer; | |
import io.cucumber.cucumberexpressions.ParameterByTypeTransformer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arun.cucumber.hello.bdd; | |
import cucumber.api.CucumberOptions; | |
import cucumber.api.junit.Cucumber; | |
import org.junit.runner.RunWith; | |
/** | |
* To run cucumber test. | |
*/ | |
@RunWith(Cucumber.class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arun.cucumber.hello.bdd; | |
import com.arun.cucumber.hello.Application; | |
import cucumber.api.java.Before; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.boot.test.context.SpringBootContextLoader; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; | |
import org.springframework.test.context.ContextConfiguration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Delete Employee | |
Background: | |
Given an employee with the following attributes | |
| id | firstName | lastName | dateOfBirth | startDate | employmentType | email | | |
| 400 | Rachel | Green | 1990-01-01 | 2018-01-01 | Permanent | rachel.green@fs.com | | |
And with the following phone numbers | |
| id | type | isdCode | phoneNumber | extension | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Update Employee | |
Background: | |
Given an employee with the following attributes | |
| id | firstName | lastName | dateOfBirth | startDate | employmentType | email | | |
| 300 | Rachel | Green | 1990-01-01 | 2018-01-01 | Permanent | rachel.green@fs.com | | |
And with the following phone numbers | |
| id | type | isdCode | phoneNumber | extension | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Get Employee | |
Background: | |
---------------------------------------------------- | |
Here an employee is setup to test get employee by id | |
---------------------------------------------------- | |
Given an employee with the following attributes | |
| id | firstName | lastName | dateOfBirth | startDate | employmentType | email | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Create Employee | |
Scenario Outline: <testCase> <expectedResult> | |
----------------------------------------------- | |
1. Create employee without first name fails. | |
2. Create employee without last name fails. | |
... other validations | |
----------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Create Employee | |
Scenario: WITH ALL REQUIRED FIELDS IS SUCCESSFUL | |
-------------------------------------------------------------------------------- | |
IMPORTANT NOTE - Field name in Employee.java is used as DataTable column header. | |
-------------------------------------------------------------------------------- | |
Given user wants to create an employee with the following attributes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.assertj.core.api.Assertions.assertThat; | |
import static org.assertj.core.api.Assertions.fail; | |
import cucumber.api.java8.En; | |
import io.cucumber.datatable.DataTable; | |
import io.restassured.response.Response; | |
import java.time.LocalDate; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; |
NewerOlder