From 662e194298a60bfa2f3f2800d6a807daa084b177 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Fri, 19 Jun 2020 13:26:15 +0200 Subject: [PATCH 1/5] =?UTF-8?q?New=20PR,=20old=20code=20=F0=9F=91=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/edit_record_2.feature | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/e2e/edit_record_2.feature b/tests/e2e/edit_record_2.feature index df7ec93a1..5d40fe49e 100644 --- a/tests/e2e/edit_record_2.feature +++ b/tests/e2e/edit_record_2.feature @@ -14,3 +14,25 @@ Feature: Preview record after editing And I reload the page And I wait 1 second Then the "field-title" field should not contain "Check preview" + + @javascript + Scenario: As an Admin I want to view saved changes of a record + Given I am logged in as "admin" + When I am on "/bolt/edit/2" + + When I fill in "field-heading" with "This is the title in the wrong locale" + And I scroll "Save changes" into view + And I press "Save changes" + + When I am on "/bolt/edit/2?edit_locale=nl" + And I fill in "field-heading" with "This is the title in the correct locale" + And I scroll "Save changes" into view + And I press "Save changes" + + Then I should be on "/bolt/edit/2?edit_locale=nl" + + When I scroll ".record-actions" into view + And I press "View saved version" + + Then I should not see "This is the title in the wrong locale" + And I should see "This is the title in the correct locale" From a0857a768da5a1998ebeb1a427df0c698f9c86b2 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Fri, 19 Jun 2020 16:04:34 +0200 Subject: [PATCH 2/5] scroll 1st .record-actions --- tests/e2e/edit_record_2.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/edit_record_2.feature b/tests/e2e/edit_record_2.feature index 5d40fe49e..532dd5bf5 100644 --- a/tests/e2e/edit_record_2.feature +++ b/tests/e2e/edit_record_2.feature @@ -31,7 +31,7 @@ Feature: Preview record after editing Then I should be on "/bolt/edit/2?edit_locale=nl" - When I scroll ".record-actions" into view + When I scroll the 1st ".record-actions" into view And I press "View saved version" Then I should not see "This is the title in the wrong locale" From 4fd6240a8fc3316ca167eefb86ff0710181b1ec2 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Fri, 19 Jun 2020 16:57:57 +0200 Subject: [PATCH 3/5] fix test scroll into view --- tests/e2e/edit_record_2.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/edit_record_2.feature b/tests/e2e/edit_record_2.feature index 532dd5bf5..f8fac001f 100644 --- a/tests/e2e/edit_record_2.feature +++ b/tests/e2e/edit_record_2.feature @@ -31,7 +31,7 @@ Feature: Preview record after editing Then I should be on "/bolt/edit/2?edit_locale=nl" - When I scroll the 1st ".record-actions" into view + When I scroll "View saved version" into view And I press "View saved version" Then I should not see "This is the title in the wrong locale" From 6fd14f9b880e591311fc5f035cf396ac42f2f96f Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Fri, 19 Jun 2020 17:21:46 +0200 Subject: [PATCH 4/5] Add title to View saved so that it is findable by tests --- templates/content/_buttons.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/content/_buttons.html.twig b/templates/content/_buttons.html.twig index 3b4e9a91c..8d74e569a 100644 --- a/templates/content/_buttons.html.twig +++ b/templates/content/_buttons.html.twig @@ -30,7 +30,7 @@
{% if record.status == "published" and record|link(true) %} - {{ macro.icon('fa-sign-out-alt') }} {{ __('action.view_saved') }} + {{ macro.icon('fa-sign-out-alt') }} {{ __('action.view_saved') }} {% endif %} {{ macro.icon('trash') }}{{ 'action.delete'|trans }} From 6a200698291c285d425cfd49c32fe017601545d9 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Mon, 22 Jun 2020 09:08:45 +0200 Subject: [PATCH 5/5] click on don't press --- templates/content/_buttons.html.twig | 2 +- tests/e2e/edit_record_2.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/content/_buttons.html.twig b/templates/content/_buttons.html.twig index 8d74e569a..3b4e9a91c 100644 --- a/templates/content/_buttons.html.twig +++ b/templates/content/_buttons.html.twig @@ -30,7 +30,7 @@