Skip to content

Instantly share code, notes, and snippets.

@bircher
Created January 24, 2018 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bircher/a1e0874bae91e086ef03117260e28c48 to your computer and use it in GitHub Desktop.
Save bircher/a1e0874bae91e086ef03117260e28c48 to your computer and use it in GitHub Desktop.
@api
Feature: Random 404s
In order to make sure the site works normally
As a administrator
I want to be able to clear caches without creating bad 404s
# @javascript
Scenario: Bad 404 after clearing cache.
# Step 1: manually create simple content to set the url alias
Given I am logged in as a user with the "administrator" role
When I am on "/node/add/page"
And I fill in "Title" with "Target page"
# And I click the "#edit-path-settings" element
And I fill in "URL alias" with "/target-page"
And I press "Save"
# Step 2: create content linking to the first one with a direct link.
Given the following content:
"""
title: English page 1
type: page
langcode: en
field_paragraphs:
-
type: page_splash
field_title: English splash title
field_subtitle: English splash subtitle
field_variant: center
field_link:
title: English target page
uri: internal:/target-page
"""
And the following translation for "page" content "English page 1":
"""
title: French page 1
type: page
langcode: fr
field_paragraphs:
-
type: page_splash
field_title: French splash title
field_subtitle: French splash subtitle
field_variant: center
field_link:
title: French target page
uri: internal:/target-page
"""
# Step 3: Verify that the page exists and visit the linking content in another language.
Given I am an anonymous user
When I am on "/target-page"
Then I should see "Target page"
When I am visiting the "page" content "English page 1"
And I switch the language to "fr"
# Step 4: clear caches and re-visit page with link.
Then the cache has been cleared
And I reload the page
#Step 5: Visit the target page.
When I am on "/target-page"
Then I should see "Target page"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment