Just add a new class to locate the expand button

This commit is contained in:
Lin Jen-Shin 2017-12-28 21:22:21 +08:00
parent 45d0be8371
commit c91718366d
2 changed files with 2 additions and 6 deletions

View File

@ -3,7 +3,7 @@
.settings-header
%h4
Deploy Keys
%button.btn.js-settings-toggle
%button.btn.js-settings-toggle.qa-expand-deploy-keys
= expanded ? 'Collapse' : 'Expand'
%p
Deploy keys allow read-only or read-write (if enabled) access to your repository. Deploy keys can be used for CI, staging or production servers. You can create a deploy key or add an existing one.

View File

@ -5,11 +5,7 @@ module QA
class Repository < Page::Base
def expand(title)
page.within('#content-body') do
find(
:xpath,
"//button[contains(text(), 'Expand')]" +
"[../h4[contains(text(), '#{title}')]]"
).click
find('.qa-expand-deploy-keys').click
end
end
end