Skip to content
Snippets Groups Projects
Commit c2ca2d89 authored by Chris Wells's avatar Chris Wells
Browse files

update tests to reflect new categories

parent fbf6d47c
No related branches found
No related tags found
No related merge requests found
......@@ -147,8 +147,8 @@ class ProjectBrowserUiTest extends WebDriverTestBase {
// Click 'Media' checkbox.
$this->clickWithWait('#67');
// Click 'Commerce/Advertising' checkbox.
$this->clickWithWait('#55');
// Click 'E-commerce' checkbox.
$this->clickWithWait('#104');
// Make sure the 'Media' module category filter is applied.
$this->assertEquals('Media', $this->getElementText('p.filter-applied:nth-child(2) .filter-applied__label'));
......@@ -167,7 +167,7 @@ class ProjectBrowserUiTest extends WebDriverTestBase {
'Kangaroo',
'9 Starts With a Higher Number',
]);
$this->assertTrue($assert_session->waitForText('23 Results'));
$this->assertTrue($assert_session->waitForText('20 Results'));
}
/**
......@@ -286,11 +286,11 @@ class ProjectBrowserUiTest extends WebDriverTestBase {
// Click 'Media' checkbox.
$this->clickWithWait('#67', '', TRUE);
// Click 'Commerce/Advertising' checkbox.
$this->clickWithWait('#55', '', TRUE);
// Click 'E-commerce' checkbox.
$this->clickWithWait('#104', '', TRUE);
// Click 'E-commerce' checkbox.
$this->clickWithWait('#104', '24 Results');
$this->clickWithWait('#104', '18 results');
$this->assertPagerItems(['1', '2', 'Next', 'Last']);
$this->clickWithWait('[aria-label="Next page"]');
......@@ -611,31 +611,32 @@ class ProjectBrowserUiTest extends WebDriverTestBase {
$assert_session->waitForElementVisible('css', '#developmentStatusactive');
$this->clickWithWait('#developmentStatusactive');
// Select the Commerce/Advertising filter.
$this->clickWithWait('#55', '', TRUE);
// Select the E-commerce filter.
$assert_session->waitForElementVisible('css', '#104');
$this->clickWithWait('#104', '', TRUE);
// Select the Media filter.
$assert_session->waitForElementVisible('css', '#67');
$this->clickWithWait('#67', '', TRUE);
$this->assertTrue($assert_session->waitForText('16 Results'));
$this->assertTrue($assert_session->waitForText('15 Results'));
$this->assertProjectsVisible([
'Octopus',
'No Scrubs',
'Mad About You',
'Looper',
'Kangaroo',
'Jazz',
'Helvetica',
'Grapefruit',
'Fire',
'Eggman',
'Doomer',
'Dancing Queen',
'Cream cheese on a bagel',
'Become a Banana',
]);
$this->clickWithWait('[aria-label="Next page"]');
$this->assertProjectsVisible([
'Become a Banana',
'Astronaut Simulator',
'9 Starts With a Higher Number',
'1 Starts With a Number',
......@@ -644,15 +645,14 @@ class ProjectBrowserUiTest extends WebDriverTestBase {
// Should still be on second results page.
$this->svelteInitHelper('css', '#project-browser .pb-project');
$this->assertProjectsVisible([
'Become a Banana',
'Astronaut Simulator',
'9 Starts With a Higher Number',
'1 Starts With a Number',
]);
$this->assertTrue($assert_session->waitForText('16 Results'));
$this->assertTrue($assert_session->waitForText('15 Results'));
$this->assertEquals('Active', $this->getElementText('p.filter-applied:nth-child(1) .filter-applied__label'));
$this->assertEquals('Commerce/Advertising', $this->getElementText('p.filter-applied:nth-child(2) .filter-applied__label'));
$this->assertEquals('E-commerce', $this->getElementText('p.filter-applied:nth-child(2) .filter-applied__label'));
$this->assertEquals('Media', $this->getElementText('p.filter-applied:nth-child(3) .filter-applied__label'));
$this->clickWithWait('[aria-label="First page"]');
......@@ -660,19 +660,19 @@ class ProjectBrowserUiTest extends WebDriverTestBase {
'Octopus',
'No Scrubs',
'Mad About You',
'Looper',
'Kangaroo',
'Jazz',
'Helvetica',
'Grapefruit',
'Fire',
'Eggman',
'Doomer',
'Dancing Queen',
'Cream cheese on a bagel',
]);
'Become a Banana',
], TRUE);
$this->assertEquals('Active', $this->getElementText('p.filter-applied:nth-child(1) .filter-applied__label'));
$this->assertEquals('Commerce/Advertising', $this->getElementText('p.filter-applied:nth-child(2) .filter-applied__label'));
$this->assertEquals('E-commerce', $this->getElementText('p.filter-applied:nth-child(2) .filter-applied__label'));
$this->assertEquals('Media', $this->getElementText('p.filter-applied:nth-child(3) .filter-applied__label'));
}
......@@ -889,8 +889,9 @@ class ProjectBrowserUiTest extends WebDriverTestBase {
$grid_text = $this->getElementText('#project-browser .pb-layout__main ul li:nth-child(7) .pb-project-categories ul li:nth-child(1)');
$this->assertEquals('E-commerce', $grid_text);
$assert_session->elementsCount('css', '#project-browser .pb-layout__main ul li:nth-child(9) .pb-project-categories ul li', 2);
$grid_text = $this->getElementText('#project-browser .pb-layout__main ul li:nth-child(9) .pb-project-categories ul li:nth-child(1)');
$this->assertEquals('Commerce/Advertising', $grid_text);
$x = 1;
$grid_text = $this->getElementText('#project-browser .pb-layout__main ul li:nth-child(7) .pb-project-categories ul li:nth-child(1)');
$this->assertEquals('E-commerce', $grid_text);
$grid_text = $this->getElementText('#project-browser .pb-layout__main ul li:nth-child(9) .pb-project-categories ul li:nth-child(2)');
$this->assertEquals('E-commerce', $grid_text);
}
......
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