From 9116cae63de1fe8b64227f525230787523f20abd Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Mon, 30 May 2016 20:12:33 +0100 Subject: [PATCH 1/5] First simple attempt at Smart Search test. --- .../AdministratorSmartSearchCest.php | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 tests/acceptance/administrator/AdministratorSmartSearchCest.php diff --git a/tests/acceptance/administrator/AdministratorSmartSearchCest.php b/tests/acceptance/administrator/AdministratorSmartSearchCest.php new file mode 100644 index 0000000..c194f1d --- /dev/null +++ b/tests/acceptance/administrator/AdministratorSmartSearchCest.php @@ -0,0 +1,143 @@ +faker = Faker\Factory::create(); + $this->title = 'SmartSearch' . $this->faker->randomNumber(); + $this->articletext = 'This is a test'; + } + + /* + * Before the tests proper, switch the WYSIWYG editor off. + * This is to make it easier to create test content. + */ + public function administratorDisableEditor(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Disable the editor before the tests proper'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to the Global Configuration page in /administrator/ and disable the plugin'); + $I->amOnPage('administrator/index.php?option=com_config'); + $I->waitForText('Global Configuration', '30', ['css' => 'h1']); + $I->selectOptionInChosen('Default Editor', 'Editor - None'); + $I->clickToolbarButton('Save & Close'); + $I->waitForText('Control Panel', '30', ['css' => 'h1']); + $I->expectTo('see a success message after saving the configuration'); + $I->see('Configuration successfully saved', ['id' => 'system-message-container']); + } + + /* + * Before the tests proper, the Smart Search content plugin must be enabled. + */ + public function administratorEnableContentPlugin(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Enabling the Smart Search content plugin before the tests proper'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to the Smart Search page in /administrator/'); + $I->amOnPage('administrator/index.php?option=com_finder'); + $I->expectTo('see a message saying that the content plugin should be enabled'); + $I->waitForElement(['link' => 'enable this plugin']); + $I->click(['link' => 'enable this plugin']); + $I->waitForText('Plugins', '30', ['css' => 'h1']); + $I->waitForElement(['link' => 'Content - Smart Search']); + $I->checkOption(['id' => 'cb0']); + $I->clickToolbarButton('Publish'); // Note: The button is called "Enable", but we need to call it "Publish" here. + $I->waitForText('Plugin successfully enabled', '30', ['class' => 'alert-message']); + } + + /* + * Purge the index. + */ + public function administratorPurgeIndex(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Purging the index'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to the Smart Search page in /administrator/ and purge the index'); + $I->amOnPage('administrator/index.php?option=com_finder'); + $I->waitForText('Smart Search', '30', ['css' => 'h1']); + $I->clickToolbarButton('Trash'); // Note: The button is called "Clear Index", but we need to call it "Trash" here. + $I->acceptPopup(); + $I->waitForText('All items have been successfully deleted', '30', ['class' => 'alert-message']); + } + + /* + * Index the current content. + */ + public function administratorRunTheIndexer(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Smart Search Indexer'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to Smart Search page in /administrator/ and index the content'); + $I->amOnPage('administrator/index.php?option=com_finder'); + $I->waitForText('Smart Search: Indexed Content', '30', ['css' => 'h1']); + $I->click(['css' => 'button[data-target="#modal-archive"]']); + $I->wait(5); + $I->switchToIframe('Smart Search Indexer'); + + // Put something here to check that it worked. + } + + /* + * Add a new article. + * Since the content plugin is enabled, this will add the article to the search index. + */ + public function administratorAddNewArticle(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Adding a new article before the tests proper'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to the Article Manager Edit page in /administrator/ and create a new article'); + $I->amOnPage('administrator/index.php?option=com_content&view=article&layout=edit'); + $I->waitForText('Articles: New', '30', ['css' => 'h1']); + + $I->fillField(['id' => 'jform_title'], $this->title); + $I->fillField(['id' => 'jform_articletext'], $this->articletext); + $I->clickToolbarButton('Save & Close'); + $I->waitForText('Articles', '30', ['css' => 'h1']); + $I->expectTo('see a success message and the article added after saving it'); + $I->see('Article successfully saved', ['id' => 'system-message-container']); + $I->see($this->title, ['id' => 'articleList']); + } + + /* + * After the tests, the Smart Search content plugin must be disabled, ready for the next test. + */ + public function administratorDisableContentPlugin(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Disabling the Smart Search content plugin, ready for the next test run'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to Plugins page in /administrator/ and disable the Smart Search Content plugin'); + $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins&filter[search]=Content - Smart Search'); + $I->waitForText('Plugins', '30', ['css' => 'h1']); + $I->waitForElement(['link' => 'Content - Smart Search']); + $I->checkOption(['id' => 'cb0']); + $I->clickToolbarButton('Unpublish'); // Note: The button is called "Disable", but we need to call it "Unpublish" here. + $I->waitForText('Plugin successfully disabled', '30', ['class' => 'alert-message']); + } +} + From b9b95daccc4099ab6886a40aa0cb53e64328effb Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Tue, 31 May 2016 09:26:32 +0100 Subject: [PATCH 2/5] Reduce the iframe wait time. --- tests/acceptance/administrator/AdministratorSmartSearchCest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/administrator/AdministratorSmartSearchCest.php b/tests/acceptance/administrator/AdministratorSmartSearchCest.php index c194f1d..deb981d 100644 --- a/tests/acceptance/administrator/AdministratorSmartSearchCest.php +++ b/tests/acceptance/administrator/AdministratorSmartSearchCest.php @@ -91,7 +91,7 @@ class AdministratorSmartSearchCest $I->amOnPage('administrator/index.php?option=com_finder'); $I->waitForText('Smart Search: Indexed Content', '30', ['css' => 'h1']); $I->click(['css' => 'button[data-target="#modal-archive"]']); - $I->wait(5); + $I->wait(1); $I->switchToIframe('Smart Search Indexer'); // Put something here to check that it worked. From 55f2b835ec9a320338b7230c9594bf9b519f453d Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Sat, 4 Jun 2016 23:19:17 +0100 Subject: [PATCH 3/5] Improvements suggested by @pritalpatel. Thanks Prital. --- .../AdministratorSmartSearchCest.php | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/acceptance/administrator/AdministratorSmartSearchCest.php b/tests/acceptance/administrator/AdministratorSmartSearchCest.php index deb981d..1edc734 100644 --- a/tests/acceptance/administrator/AdministratorSmartSearchCest.php +++ b/tests/acceptance/administrator/AdministratorSmartSearchCest.php @@ -29,10 +29,10 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to the Global Configuration page in /administrator/ and disable the plugin'); $I->amOnPage('administrator/index.php?option=com_config'); - $I->waitForText('Global Configuration', '30', ['css' => 'h1']); + $I->waitForText('Global Configuration', 30, ['class' => 'page-title']); $I->selectOptionInChosen('Default Editor', 'Editor - None'); $I->clickToolbarButton('Save & Close'); - $I->waitForText('Control Panel', '30', ['css' => 'h1']); + $I->waitForText('Control Panel', 30, ['class'=> 'page-title']); $I->expectTo('see a success message after saving the configuration'); $I->see('Configuration successfully saved', ['id' => 'system-message-container']); } @@ -52,11 +52,11 @@ class AdministratorSmartSearchCest $I->expectTo('see a message saying that the content plugin should be enabled'); $I->waitForElement(['link' => 'enable this plugin']); $I->click(['link' => 'enable this plugin']); - $I->waitForText('Plugins', '30', ['css' => 'h1']); + $I->waitForText('Plugins', 30, ['class'=> 'page-title']); $I->waitForElement(['link' => 'Content - Smart Search']); $I->checkOption(['id' => 'cb0']); $I->clickToolbarButton('Publish'); // Note: The button is called "Enable", but we need to call it "Publish" here. - $I->waitForText('Plugin successfully enabled', '30', ['class' => 'alert-message']); + $I->waitForText('Plugin successfully enabled', 30, ['class' => 'alert-message']); } /* @@ -71,10 +71,10 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to the Smart Search page in /administrator/ and purge the index'); $I->amOnPage('administrator/index.php?option=com_finder'); - $I->waitForText('Smart Search', '30', ['css' => 'h1']); + $I->waitForText('Smart Search', 30, ['class'=> 'page-title']); $I->clickToolbarButton('Trash'); // Note: The button is called "Clear Index", but we need to call it "Trash" here. $I->acceptPopup(); - $I->waitForText('All items have been successfully deleted', '30', ['class' => 'alert-message']); + $I->waitForText('All items have been successfully deleted', 30, ['class' => 'alert-message']); } /* @@ -89,10 +89,11 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to Smart Search page in /administrator/ and index the content'); $I->amOnPage('administrator/index.php?option=com_finder'); - $I->waitForText('Smart Search: Indexed Content', '30', ['css' => 'h1']); + $I->waitForText('Smart Search: Indexed Content', 30, ['class'=> 'page-title']); $I->click(['css' => 'button[data-target="#modal-archive"]']); $I->wait(1); - $I->switchToIframe('Smart Search Indexer'); + $I->switchToIFrame('Smart Search Indexer'); + $I->checkForPhpNoticesOrWarnings(); // Put something here to check that it worked. } @@ -100,6 +101,8 @@ class AdministratorSmartSearchCest /* * Add a new article. * Since the content plugin is enabled, this will add the article to the search index. + * + * @todo Revisit this when Gherkin is available. */ public function administratorAddNewArticle(\Step\Acceptance\weblink $I) { @@ -109,13 +112,15 @@ class AdministratorSmartSearchCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to the Article Manager Edit page in /administrator/ and create a new article'); - $I->amOnPage('administrator/index.php?option=com_content&view=article&layout=edit'); - $I->waitForText('Articles: New', '30', ['css' => 'h1']); + $I->amOnPage('administrator/index.php?option=com_content'); + $I->waitForText('Articles', 30, ['class'=> 'page-title']); + $I->clickToolbarButton('New'); + $I->waitForText('Articles: New', 30, ['class'=> 'page-title']); $I->fillField(['id' => 'jform_title'], $this->title); $I->fillField(['id' => 'jform_articletext'], $this->articletext); $I->clickToolbarButton('Save & Close'); - $I->waitForText('Articles', '30', ['css' => 'h1']); + $I->waitForText('Articles', 30, ['class'=> 'page-title']); $I->expectTo('see a success message and the article added after saving it'); $I->see('Article successfully saved', ['id' => 'system-message-container']); $I->see($this->title, ['id' => 'articleList']); @@ -132,12 +137,13 @@ class AdministratorSmartSearchCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to Plugins page in /administrator/ and disable the Smart Search Content plugin'); - $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins&filter[search]=Content - Smart Search'); - $I->waitForText('Plugins', '30', ['css' => 'h1']); + $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins'); + $I->searchForItem('Content - Smart Search'); + $I->waitForText('Plugins', 30, ['class'=> 'page-title']); $I->waitForElement(['link' => 'Content - Smart Search']); $I->checkOption(['id' => 'cb0']); $I->clickToolbarButton('Unpublish'); // Note: The button is called "Disable", but we need to call it "Unpublish" here. - $I->waitForText('Plugin successfully disabled', '30', ['class' => 'alert-message']); + $I->waitForText('Plugin successfully disabled', 30, ['class' => 'alert-message']); } } From 9fb8d3e6fb42d9d3025600dc2cc7b80c163fb304 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Wed, 22 Jun 2016 14:55:45 +0200 Subject: [PATCH 4/5] Update Smart search tests --- tests/_support/Step/Acceptance/weblink.php | 31 ++++ .../AdministratorSmartSearchCest.php | 132 ++++++++++-------- 2 files changed, 108 insertions(+), 55 deletions(-) diff --git a/tests/_support/Step/Acceptance/weblink.php b/tests/_support/Step/Acceptance/weblink.php index c28b2a4..075e789 100644 --- a/tests/_support/Step/Acceptance/weblink.php +++ b/tests/_support/Step/Acceptance/weblink.php @@ -44,4 +44,35 @@ class weblink extends \AcceptanceTester $I->clickToolbarButton('Save & Close'); $I->waitForText('Web link successfully saved', '30', ['id' => 'system-message-container']); } + + public function administratorDeleteWeblink($title) + { + $I = $this; + + $I->amGoingTo('Navigate to Weblinks page in /administrator/'); + $I->amOnPage('administrator/index.php?option=com_weblinks'); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->expectTo('see weblinks page'); + + $I->amGoingTo('Search for the weblink'); + $I->searchForItem($title); + $I->waitForText('Web Links','30',['css' => 'h1']); + + $I->amGoingTo('Trash the weblink'); + $I->checkAllResults(); + $I->clickToolbarButton('Trash'); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->waitForText('Web link successfully trashed', 30, ['id' => 'system-message-container']); + + $I->amGoingTo('Delete the weblink'); + $I->selectOptionInChosen('- Select Status -', 'Trashed'); + $I->amGoingTo('Search the just saved weblink'); + $I->searchForItem($title); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->checkAllResults(); + $I->click(['xpath'=> '//div[@id="toolbar-delete"]/button']); + $I->acceptPopup(); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->waitForText('1 web link successfully deleted.', 30, ['id' => 'system-message-container']); + } } \ No newline at end of file diff --git a/tests/acceptance/administrator/AdministratorSmartSearchCest.php b/tests/acceptance/administrator/AdministratorSmartSearchCest.php index 1edc734..175b324 100644 --- a/tests/acceptance/administrator/AdministratorSmartSearchCest.php +++ b/tests/acceptance/administrator/AdministratorSmartSearchCest.php @@ -12,13 +12,13 @@ class AdministratorSmartSearchCest public function __construct() { $this->faker = Faker\Factory::create(); - $this->title = 'SmartSearch' . $this->faker->randomNumber(); + $this->title = $this->faker->bothify('SmartSearch ?##?'); + $this->url = $this->faker->url; $this->articletext = 'This is a test'; } - /* - * Before the tests proper, switch the WYSIWYG editor off. - * This is to make it easier to create test content. + /** + * Before the tests proper, switch the WYSIWYG editor off. This is to make it easier to create test content. */ public function administratorDisableEditor(\Step\Acceptance\weblink $I) { @@ -27,7 +27,7 @@ class AdministratorSmartSearchCest $I->doAdministratorLogin(); - $I->amGoingTo('Navigate to the Global Configuration page in /administrator/ and disable the plugin'); + $I->amGoingTo('Navigate to the Global Configuration page in /administrator/ and disable the WYSIWYG Editor'); $I->amOnPage('administrator/index.php?option=com_config'); $I->waitForText('Global Configuration', 30, ['class' => 'page-title']); $I->selectOptionInChosen('Default Editor', 'Editor - None'); @@ -37,29 +37,46 @@ class AdministratorSmartSearchCest $I->see('Configuration successfully saved', ['id' => 'system-message-container']); } - /* - * Before the tests proper, the Smart Search content plugin must be enabled. - */ public function administratorEnableContentPlugin(\Step\Acceptance\weblink $I) { $I->am('Administrator'); - $I->wantToTest('Enabling the Smart Search content plugin before the tests proper'); + $I->wantToTest('Enabling the Smart Search content plugin. Note that this is not a requirement for Smart Search to index Weblinks'); $I->doAdministratorLogin(); $I->amGoingTo('Navigate to the Smart Search page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_finder'); $I->expectTo('see a message saying that the content plugin should be enabled'); - $I->waitForElement(['link' => 'enable this plugin']); - $I->click(['link' => 'enable this plugin']); - $I->waitForText('Plugins', 30, ['class'=> 'page-title']); - $I->waitForElement(['link' => 'Content - Smart Search']); - $I->checkOption(['id' => 'cb0']); - $I->clickToolbarButton('Publish'); // Note: The button is called "Enable", but we need to call it "Publish" here. - $I->waitForText('Plugin successfully enabled', 30, ['class' => 'alert-message']); + $I->waitForElement(['link' => 'Smart Search Content Plugin']); + $I->click(['link' => 'Smart Search Content Plugin']); + $I->waitForText('Plugins: Content - Smart Search', 30, ['class'=> 'page-title']); + $I->selectOptionInChosen('Status', 'Enabled'); + $I->clickToolbarButton('save & close'); + $I->waitForText('Plugin successfully saved.', 30, ['id' => 'system-message-container']); + $I->see('Plugin successfully saved.', ['id' => 'system-message-container']); } - /* + /** + * Before the tests proper, the Weblinks Smart Search plugin must be enabled. + */ + public function administratorEnableSmartsearchWeblinksPlugin(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Enabling the Smart Search Weblinks plugin'); + + $I->doAdministratorLogin(); + + $I->amOnPage('administrator/index.php?option=com_plugins'); + $I->searchForItem('Smart Search - Web Links'); + $I->click(['link' => 'Smart Search - Web Links']); + $I->waitForText('Plugins: Smart Search - Web Links', 30, ['class'=> 'page-title']); + $I->selectOptionInChosen('Status', 'Enabled'); + $I->clickToolbarButton('save & close'); + $I->waitForText('Plugin successfully saved.', 30, ['id' => 'system-message-container']); + $I->see('Plugin successfully saved.', ['id' => 'system-message-container']); + } + + /** * Purge the index. */ public function administratorPurgeIndex(\Step\Acceptance\weblink $I) @@ -72,12 +89,21 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to the Smart Search page in /administrator/ and purge the index'); $I->amOnPage('administrator/index.php?option=com_finder'); $I->waitForText('Smart Search', 30, ['class'=> 'page-title']); - $I->clickToolbarButton('Trash'); // Note: The button is called "Clear Index", but we need to call it "Trash" here. + + $I->click('Clear Index'); $I->acceptPopup(); $I->waitForText('All items have been successfully deleted', 30, ['class' => 'alert-message']); + $I->see('All items have been successfully deleted', ['class' => 'alert-message']); } - /* + public function administratorCreateWeblink(\Step\Acceptance\weblink $I) + { + $I->doAdministratorLogin(); + + $I->createWeblink($this->title, $this->url); + } + + /** * Index the current content. */ public function administratorRunTheIndexer(\Step\Acceptance\weblink $I) @@ -90,43 +116,13 @@ class AdministratorSmartSearchCest $I->amGoingTo('Navigate to Smart Search page in /administrator/ and index the content'); $I->amOnPage('administrator/index.php?option=com_finder'); $I->waitForText('Smart Search: Indexed Content', 30, ['class'=> 'page-title']); - $I->click(['css' => 'button[data-target="#modal-archive"]']); - $I->wait(1); - $I->switchToIFrame('Smart Search Indexer'); - $I->checkForPhpNoticesOrWarnings(); - - // Put something here to check that it worked. + $I->click(['xpath' => "//div[@id='toolbar']//button[contains(text()[normalize-space()], 'Index')]"]); + $I->comment('I wait while smart search indexes the links'); + $I->wait(2); + $I->waitForText($this->title, 30, '#j-main-container'); } - /* - * Add a new article. - * Since the content plugin is enabled, this will add the article to the search index. - * - * @todo Revisit this when Gherkin is available. - */ - public function administratorAddNewArticle(\Step\Acceptance\weblink $I) - { - $I->am('Administrator'); - $I->wantToTest('Adding a new article before the tests proper'); - - $I->doAdministratorLogin(); - - $I->amGoingTo('Navigate to the Article Manager Edit page in /administrator/ and create a new article'); - $I->amOnPage('administrator/index.php?option=com_content'); - $I->waitForText('Articles', 30, ['class'=> 'page-title']); - $I->clickToolbarButton('New'); - $I->waitForText('Articles: New', 30, ['class'=> 'page-title']); - - $I->fillField(['id' => 'jform_title'], $this->title); - $I->fillField(['id' => 'jform_articletext'], $this->articletext); - $I->clickToolbarButton('Save & Close'); - $I->waitForText('Articles', 30, ['class'=> 'page-title']); - $I->expectTo('see a success message and the article added after saving it'); - $I->see('Article successfully saved', ['id' => 'system-message-container']); - $I->see($this->title, ['id' => 'articleList']); - } - - /* + /** * After the tests, the Smart Search content plugin must be disabled, ready for the next test. */ public function administratorDisableContentPlugin(\Step\Acceptance\weblink $I) @@ -145,5 +141,31 @@ class AdministratorSmartSearchCest $I->clickToolbarButton('Unpublish'); // Note: The button is called "Disable", but we need to call it "Unpublish" here. $I->waitForText('Plugin successfully disabled', 30, ['class' => 'alert-message']); } -} + /** + * After the tests, the Smart Search content plugin must be disabled, ready for the next test. + */ + public function administratorDisableSmartsearchWeblinksPlugin(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Disabling the Smart Search content plugin, ready for the next test run'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to Plugins page in /administrator/ and disable the Smart Search Content plugin'); + $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins'); + $I->searchForItem('Smart Search - Web Links'); + $I->waitForText('Plugins', 30, ['class'=> 'page-title']); + $I->waitForElement(['link' => 'Smart Search - Web Links']); + $I->checkOption(['id' => 'cb0']); + $I->clickToolbarButton('Unpublish'); // Note: The button is called "Disable", but we need to call it "Unpublish" here. + $I->waitForText('Plugin successfully disabled', 30, ['class' => 'alert-message']); + } + + public function cleanUp(\Step\Acceptance\weblink $I) + { + $I->doAdministratorLogin(); + + $I->administratorDeleteWeblink($this->title); + } +} From 5bc5e45624c31af7ead2439642aee4b637247b60 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Wed, 22 Jun 2016 15:02:33 +0200 Subject: [PATCH 5/5] Fix delete message --- tests/_support/Step/Acceptance/weblink.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_support/Step/Acceptance/weblink.php b/tests/_support/Step/Acceptance/weblink.php index 075e789..e7bed69 100644 --- a/tests/_support/Step/Acceptance/weblink.php +++ b/tests/_support/Step/Acceptance/weblink.php @@ -62,7 +62,7 @@ class weblink extends \AcceptanceTester $I->checkAllResults(); $I->clickToolbarButton('Trash'); $I->waitForText('Web Links','30',['css' => 'h1']); - $I->waitForText('Web link successfully trashed', 30, ['id' => 'system-message-container']); + $I->waitForText('1 web link successfully trashed', 30, ['id' => 'system-message-container']); $I->amGoingTo('Delete the weblink'); $I->selectOptionInChosen('- Select Status -', 'Trashed');