Fix the Cucumber tests so they pass

With the change of factories, single Cucumber test stopped
working due to text in the test being dependant on a now randomly
(Faker) defined value.
This commit is contained in:
Luka Murn 2019-01-21 15:06:39 +01:00
parent 38d303b658
commit 208ef0bfe1
2 changed files with 7 additions and 9 deletions

View file

@ -23,19 +23,12 @@ Feature: Team settings
Then I click "Save" button
And I should see "BioSistemika Process Company" on "#team-name" element
@javascript
Scenario: Successfully adds team description
Given I'm on "BioSistemika Process" team settings page
Then I click on ".description-label" element
And I fill in "I was on Triglav one summer." in "team_description" textarea field
Then I click "Save" button
And I should see "I was on Triglav one summer." on ".description-label" element
@javascript
Scenario: Successfully changes team description
Given I'm on "BioSistemika Process" team settings page
Then I click on ".description-label" element
And I change "Lorem ipsum dolor sit amet, consectetuer adipiscing eli." with "I was on Triglav one summer." in "team_description" textarea field
Then I should not see "I was on Triglav one summer." on ".description-label" element
And I fill in "I was on Triglav one summer." in "team_description" textarea field
Then I click "Save" button
And I should see "I was on Triglav one summer." on ".description-label" element

View file

@ -128,6 +128,11 @@ Then(/^I change "([^"]*)" with "([^"]*)" in "([^"]*)" textarea field$/) do |old_
textarea.set(new_text)
end
Then(/^I should not see "([^"]*)" on "([^"]*)" element$/) do |text, element|
wait_for_ajax
expect(find(element)).not_to have_content(text)
end
Then(/^I should see "([^"]*)" on "([^"]*)" element$/) do |text, element|
wait_for_ajax
expect(find(element)).to have_content(text)