Skip to content
Snippets Groups Projects
Commit f54e2068 authored by Dominik Wille's avatar Dominik Wille
Browse files

Issue #3469140 by Harlor: Make tests pass

parent b67365ac
No related branches found
No related tags found
1 merge request!1Fix source in composer.json
Pipeline #260015 passed with warnings
......@@ -4,7 +4,7 @@
"type": "drupal-module",
"description": "Integrate a single-page application into your website using a block.",
"support": {
"source": "git@git.erdfisch.de:contrib/spa.git"
"source": "https://git.drupalcode.org/project/spa"
},
"require": {
"php": ">=8.1",
......
......@@ -43,16 +43,16 @@ class SpaFormTest extends WebDriverTestBase {
// Basic settings.
$page = $this->getSession()->getPage();
$page->selectFieldOption('arguments[actions][add_plugin_id]', 'static');
$page->selectFieldOption('arguments[new_plugin][id]', 'static');
$page->fillField('label', 'Test SPA');
sleep(2);
$this->assertSession()->assertWaitOnAjaxRequest();
// $this->assertSession()->assertWaitOnAjaxRequest();
// Add an argument
$page->pressButton('add arguments');
$page->pressButton('Add Argument');
sleep(1);
$this->assertSession()->pageTextContains('Argument name');
$page->pressButton('add arguments');
$page->pressButton('Add Argument');
sleep(1);
$uuids = $this->getUUIDs('arguments');
$i = 0;
......@@ -76,20 +76,21 @@ class SpaFormTest extends WebDriverTestBase {
$this->drupalGet(Url::fromRoute('entity.spa.edit_form', ['spa' => 'test_spa']));
// Add a context more argument
$page = $this->getSession()->getPage();
$page->selectFieldOption('arguments[actions][add_plugin_id]', 'context');
$page->pressButton('add arguments');
$page->selectFieldOption('arguments[new_plugin][id]', 'context');
$page->pressButton('Add Argument');
sleep(1);
self::assertCount(2, $uuids);
// Remove the 0 arg
$tab = $page->find('css', '[href^="#edit-arguments-'.$uuids[0].'"]');
$tab = $page->find('xpath', "//a[contains(@href, '#edit-arguments-".$uuids[0]."')]");
$tab->click();
$page->find('css', '[name="remove '.$uuids[0].' arguments"]')->click();
$page->find('css', '[name="remove-plugin-'.$uuids[0].'"]')->click();
sleep(1);
$uuids = $this->getUUIDs('arguments');
// Add a library
$page->selectFieldOption('libraries[actions][add_plugin_id]', 'css_snippet');
$page->pressButton('add libraries');
$page->selectFieldOption('libraries[new_plugin][id]', 'css_snippet');
$page->pressButton('Add Library');
sleep(1);
$library_uuids = $this->getUUIDs('libraries');
$page->fillField('libraries['.$library_uuids[0].'][css]', '.foo { display: block; }');
......
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