Skip to content
Snippets Groups Projects
Verified Commit 9e84cb4e authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3293469 by bnjmnm, dmundra, finnsky, Anchal_gupta, andypost, lauriii,...

Issue #3293469 by bnjmnm, dmundra, finnsky, Anchal_gupta, andypost, lauriii, xjm, nod_, rikki_iki: Automated A11y tests in Nightwatch
parent 70cfa8b4
No related branches found
No related tags found
26 merge requests!54479.5.x SF update,!5014Issue #3071143: Table Render Array Example Is Incorrect,!4868Issue #1428520: Improve menu parent link selection,!4289Issue #1344552 by marcingy, Niklas Fiekas, Ravi.J, aleevas, Eduardo Morales...,!4114Issue #2707291: Disable body-level scrolling when a dialog is open as a modal,!4100Issue #3249600: Add support for PHP 8.1 Enums as allowed values for list_* data types,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2334Issue #3228209: Add hasRole() method to AccountInterface,!2062Issue #3246454: Add weekly granularity to views date sort,!1591Issue #3199697: Add JSON:API Translation experimental module,!1484Exposed filters get values from URL when Ajax is on,!1255Issue #3238922: Refactor (if feasible) uses of the jQuery serialize function to use vanillaJS,!1162Issue #3100350: Unable to save '/' root path alias,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!925Issue #2339235: Remove taxonomy hard dependency on node module,!877Issue #2708101: Default value for link text is not saved,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!844Resolve #3036010 "Updaters",!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!485Sets the autocomplete attribute for username/password input field on login form.,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
Showing
with 570 additions and 0 deletions
name: 'Nightwatch theme install utility'
type: module
description: 'Helper module facilitate theme installation in Nightwatch tests'
package: Testing
version: VERSION
nightwatch_utility.theme_install_default:
path: '/admin/theme/install_default/{theme}'
defaults:
_controller: '\Drupal\nightwatch_theme_install_utility\Controller\ThemeInstallController::installDefault'
requirements:
_permission: 'administer themes'
nightwatch_utility.theme_install_admin:
path: '/admin/theme/install_admin/{theme}'
defaults:
_controller: '\Drupal\nightwatch_theme_install_utility\Controller\ThemeInstallController::installAdmin'
requirements:
_permission: 'administer themes'
<?php
namespace Drupal\nightwatch_theme_install_utility\Controller;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Extension\ThemeInstallerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides an easier way for Nightwatch tests to install themes.
*/
class ThemeInstallController extends ControllerBase {
/**
* The theme installer service.
*
* @var \Drupal\Core\Extension\ThemeInstallerInterface
*/
protected $themeInstaller;
/**
* Constructs a new ThemeInstallController.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer
* The theme installer.
*/
public function __construct(ConfigFactoryInterface $config_factory, ThemeInstallerInterface $theme_installer) {
$this->configFactory = $config_factory;
$this->themeInstaller = $theme_installer;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('theme_installer')
);
}
/**
* Install a theme as default.
*
* @param string $theme
* The theme to install as the default theme.
*
* @return array
* A render array confirming installation.
*/
public function installDefault(string $theme) {
return $this->installTheme($theme, 'default');
}
/**
* Install a theme as the admin theme.
* @param string $theme
* The theme to install as the admin theme.
*
* @return array
* A render array confirming installation.
*/
public function installAdmin($theme) {
return $this->installTheme($theme, 'admin');
}
/**
* Installs a theme.
*
* @param string $theme
* The theme to install.
* @param string $default_or_admin
* Which type of theme to install, can be `default` or `admin`.
*
* @return array
* A render array confirming installation.
*/
private function installTheme($theme, $default_or_admin): array {
assert(in_array($default_or_admin, ['default', 'admin']), 'The $default_or_admin parameter must be `default` or `admin`');
$config = $this->configFactory->getEditable('system.theme');
$this->themeInstaller->install([$theme]);
$config->set($default_or_admin, $theme)->save();
return [
'#type' => 'container',
'#attributes' => ['id' => 'theme-installed'],
'#markup' => "Installed $theme as $default_or_admin theme",
];
}
}
langcode: en
status: true
dependencies:
config:
- field.field.node.article.body
- field.field.node.article.comment
- field.field.node.article.field_image
- field.field.node.article.field_tags
- image.style.thumbnail
- node.type.article
module:
- comment
- image
- path
- text
id: node.article.default
targetEntityType: node
bundle: article
mode: default
content:
body:
type: text_textarea_with_summary
weight: 1
region: content
settings:
rows: 9
summary_rows: 3
placeholder: ''
show_summary: false
third_party_settings: { }
comment:
type: comment_default
weight: 20
region: content
settings: { }
third_party_settings: { }
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_image:
type: image_image
weight: 4
region: content
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
field_tags:
type: entity_reference_autocomplete_tags
weight: 3
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
weight: 15
region: content
settings:
display_label: true
third_party_settings: { }
status:
type: boolean_checkbox
weight: 120
region: content
settings:
display_label: true
third_party_settings: { }
sticky:
type: boolean_checkbox
weight: 16
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
langcode: en
status: true
dependencies:
config:
- field.field.node.page.body
- node.type.page
module:
- path
- text
id: node.page.default
targetEntityType: node
bundle: page
mode: default
content:
body:
type: text_textarea_with_summary
weight: 31
region: content
settings:
rows: 9
summary_rows: 3
placeholder: ''
show_summary: false
third_party_settings: { }
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
weight: 15
region: content
settings:
display_label: true
third_party_settings: { }
status:
type: boolean_checkbox
weight: 120
region: content
settings:
display_label: true
third_party_settings: { }
sticky:
type: boolean_checkbox
weight: 16
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: -5
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
langcode: en
status: true
dependencies:
config:
- field.storage.node.body
- node.type.article
module:
- text
id: node.article.body
field_name: body
entity_type: node
bundle: article
label: Body
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
display_summary: true
required_summary: false
field_type: text_with_summary
langcode: en
status: true
dependencies:
config:
- field.storage.node.comment
- node.type.article
module:
- comment
id: node.article.comment
field_name: comment
entity_type: node
bundle: article
label: Comments
description: ''
required: false
translatable: true
default_value:
-
status: 2
cid: 0
last_comment_timestamp: 0
last_comment_name: null
last_comment_uid: 0
comment_count: 0
default_value_callback: ''
settings:
default_mode: 1
per_page: 50
anonymous: 0
form_location: true
preview: 1
field_type: comment
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_image
- node.type.article
module:
- image
id: node.article.field_image
field_name: field_image
entity_type: node
bundle: article
label: Image
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'png gif jpg jpeg'
max_filesize: ''
max_resolution: ''
min_resolution: ''
alt_field: true
alt_field_required: true
title_field: false
title_field_required: false
default_image:
uuid: null
alt: ''
title: ''
width: null
height: null
field_type: image
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_tags
- node.type.article
- taxonomy.vocabulary.tags
id: node.article.field_tags
field_name: field_tags
entity_type: node
bundle: article
label: Tags
description: 'Enter a comma-separated list. For example: Amsterdam, Mexico City, "Cleveland, Ohio"'
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:taxonomy_term'
handler_settings:
target_bundles:
tags: tags
sort:
field: _none
auto_create: true
field_type: entity_reference
langcode: en
status: true
dependencies:
config:
- field.storage.node.body
- node.type.page
module:
- text
id: node.page.body
field_name: body
entity_type: node
bundle: page
label: Body
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
display_summary: true
required_summary: false
field_type: text_with_summary
langcode: en
status: true
dependencies:
module:
- comment
- node
id: node.comment
field_name: comment
entity_type: node
type: comment
settings:
comment_type: comment
module: comment
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
langcode: en
status: true
dependencies:
module:
- file
- image
- node
id: node.field_image
field_name: field_image
entity_type: node
type: image
settings:
target_type: file
display_field: false
display_default: false
uri_scheme: public
default_image:
uuid: null
alt: ''
title: ''
width: null
height: null
module: image
locked: false
cardinality: 1
translatable: true
indexes:
target_id:
- target_id
persist_with_no_fields: false
custom_storage: false
langcode: en
status: true
dependencies:
module:
- node
- taxonomy
id: node.field_tags
field_name: field_tags
entity_type: node
type: entity_reference
settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
langcode: en
status: true
dependencies: { }
name: 'Restricted HTML'
format: restricted_html
weight: 1
roles:
- anonymous
filters:
filter_html:
id: filter_html
provider: filter
status: true
weight: -10
settings:
allowed_html: '<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>'
filter_html_help: true
filter_html_nofollow: false
filter_autop:
id: filter_autop
provider: filter
status: true
weight: 0
settings: { }
filter_url:
id: filter_url
provider: filter
status: true
weight: 0
settings:
filter_url_length: 72
use_admin_theme: true
langcode: en
status: true
dependencies: { }
name: Article
type: article
description: 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.'
help: ''
new_revision: true
preview_mode: 1
display_submitted: true
langcode: en
status: true
dependencies: { }
name: 'Basic page'
type: page
description: 'Use <em>basic pages</em> for your static content, such as an ''About us'' page.'
help: ''
new_revision: true
preview_mode: 1
display_submitted: false
admin: claro
default: olivero
langcode: en
status: true
dependencies: { }
name: Tags
vid: tags
description: 'Use tags to group articles on similar topics into categories.'
weight: 0
langcode: en
status: true
dependencies: { }
id: administrator
label: Administrator
weight: 3
is_admin: true
permissions: { }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment