Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
update (#1588)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorgiumellizup authored May 31, 2021
1 parent b169a08 commit a055290
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,17 @@ class GenericSteps : AbstractStep() {
}

@Then("^a dialog should appear on the screen with text (.*)$")
fun checkDialog(string : String){
fun checkDialog(string: String) {
waitForElementWithTextToBeClickable(string, true, true)
}

@Then("^the screen should show an element with the place holder (.*)$")
fun checkElementByPlaceHolder(placeHolderText: String) {
waitForElementWithValueToBeClickable(placeHolderText, likeSearch = false, ignoreCase = false)
}

@Then("^the screen should show an element with the title (.*)$")
fun checkElementByTitle(titleText: String) {
waitForElementWithTextToBeClickable(titleText, likeSearch = false, ignoreCase = false)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import io.cucumber.java.en.When
class SimpleFormScreenSteps : AbstractStep() {
override var bffRelativeUrlPath = "/simpleform"

@Before("@simpleform")
@Before("@simpleForm")
fun setup() {
loadBffScreen()
}
Expand All @@ -35,42 +35,17 @@ class SimpleFormScreenSteps : AbstractStep() {
waitForElementWithValueToBeClickable("SimpleForm", false, false)
}

@Then("^checks that the textInput with the place holder (.*) is on the screen$")
fun checkTextInputEmailInSimpleForm(field: String) {
waitForElementWithValueToBeClickable(field, false, false)
}

@Then("^checks that the button with the title (.*) is on the screen$")
fun checkButtonOnScreen(textButton: String) {
waitForElementWithValueToBeClickable(textButton, false, false)
}

@When("^I click on textInput for email with (.*) and insert my (.*)$")
fun insertEmailInTextInput(hint: String, email: String) {
var element: MobileElement = waitForElementWithValueToBeClickable(hint, false, false)
@When("^I click on textInput with place holder (.*) and insert the value (.*)$")
fun insertEmailInTextInput(placeHolderText: String, value: String) {
var element: MobileElement = waitForElementWithValueToBeClickable(placeHolderText, false, false)
element.click()
element.sendKeys(email)
hideKeyboard()
element.sendKeys(value)

}

@When("^I click on textInput for name with (.*) and insert my (.*)$")
fun insertNameInTextInput(hint: String, name: String) {
var element: MobileElement = waitForElementWithValueToBeClickable(hint, false, false)
element.click()
element.sendKeys(name)
hideKeyboard()
}

@When("^I click to (.*)$")
fun sendDataFromTextInputs(submit: String) {
waitForElementWithValueToBeClickable(submit, false, false).click()
}

@Then("^verify if (.*) appear correctly$")
fun checkIfTextInputDataIsEqualAlert(alertData: String) {
waitForElementWithValueToBeClickable(alertData, false, false)
waitForElementWithValueToBeClickable("Registered data", false, false)

}
}
37 changes: 18 additions & 19 deletions tests/appium/project/src/test/resources/features/SimpleForm.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,27 @@
# limitations under the License.
#

@simpleform @android @ios
@simpleForm @android @ios
Feature: SimpleForm Component Validation

As a Beagle developer/user
I'd like to make sure my SimpleForm component works as expected
In order to guarantee that my application never fails
As a Beagle developer/user
I'd like to make sure my SimpleForm component works as expected
In order to guarantee that my application never fails

Background:
Given that I'm on the simple form screen

Background:
Given that I'm on the simple form screen
Scenario: SimpleForm 01 - Validate if SimpleForm children components appear on the screen
Then the screen should show an element with the place holder Type in your email
Then the screen should show an element with the place holder Type in your name
Then the screen should show an element with the title Click to Submit

Scenario: SimpleForm 01 - Checking if simpleForm children components appear on the screen
Then checks that the textInput with the place holder Type in your email is on the screen
Then checks that the textInput with the place holder Type in your name is on the screen
Then checks that the button with the title Click to Submit is on the screen
Scenario Outline: SimpleForm 02 - Validate the operation of the onSubmit attribute
When I click on textInput with place holder Type in your email and insert the value <email>
And I click on textInput with place holder Type in your name and insert the value <name>
And I click on button Click to Submit
Then a dialog should appear on the screen with text the email: <email> and the name: <name>

Scenario Outline: SimpleForm 02 - Verification of the operation of the onSubmit attribute
When I click on textInput for email with Type in your email and insert my <email>
When I click on textInput for name with Type in your name and insert my <name>
When I click to Click to Submit
Then verify if the email: <email> and the name: <name> appear correctly

Examples:
| email | name |
| teste@simpleform.com | joao |
Examples:
| email | name |
| teste@simpleform.com | joao |

0 comments on commit a055290

Please sign in to comment.