browser test: fix logic to find edit action
The simple math test failed to find the edit link on a non existent page. It was looking for the text 'Create source' from Vector which is now simply 'Create'. Change the PageObject selector to use a CSS selector, more robust to text changes. Change-Id: Ifcbd07da8e343b5697fcff6af6ffac90ff4d6420
This commit is contained in:
parent
3256537366
commit
0cebe64840
|
@ -15,7 +15,7 @@ Feature: Math
|
|||
Scenario: Display simple math
|
||||
Given I am logged in
|
||||
And I am at page that does not exist
|
||||
When I click link Create source
|
||||
When I click link Create
|
||||
And I type <math>3 + 2</math>
|
||||
And I click Preview
|
||||
Then the page should contain an img tag
|
||||
|
|
|
@ -14,8 +14,8 @@ Given(/^I am at page that does not exist$/) do
|
|||
visit(DoesNotExistPage, using_params: { page_name: @random_string })
|
||||
end
|
||||
|
||||
When(/^I click link Create source$/) do
|
||||
on(DoesNotExistPage).create_source_element.when_present.click
|
||||
When(/^I click link Create$/) do
|
||||
on(DoesNotExistPage).action_edit_element.when_present.click
|
||||
end
|
||||
|
||||
When(/^I click Preview$/) do
|
||||
|
|
|
@ -14,5 +14,5 @@ class DoesNotExistPage
|
|||
|
||||
page_url '<%=params[:page_name]%>'
|
||||
|
||||
a(:create_source, text: 'Create source')
|
||||
a(:action_edit, css: 'li#ca-edit > span > a')
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue