From c91718366d0af94de6d67afe1f2fe35076e20f26 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 28 Dec 2017 21:22:21 +0800 Subject: [PATCH] Just add a new class to locate the expand button --- app/views/projects/deploy_keys/_index.html.haml | 2 +- qa/qa/page/project/settings/repository.rb | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/views/projects/deploy_keys/_index.html.haml b/app/views/projects/deploy_keys/_index.html.haml index e75ae87e771..75dd4c9ae15 100644 --- a/app/views/projects/deploy_keys/_index.html.haml +++ b/app/views/projects/deploy_keys/_index.html.haml @@ -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. diff --git a/qa/qa/page/project/settings/repository.rb b/qa/qa/page/project/settings/repository.rb index 740fb91d62e..5d73911c697 100644 --- a/qa/qa/page/project/settings/repository.rb +++ b/qa/qa/page/project/settings/repository.rb @@ -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