Completed
Push — master ( 0ea243...da58d4 )
by Henry
10:25 queued 33s
created

ContentTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 45
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testTitle() 0 11 1
A testLayout() 0 18 1
1
<?php
2
namespace Redaxscript\Tests;
3
4
use Facebook\WebDriver\WebDriverBy;
5
6
/**
7
 * ContentTest
8
 *
9
 * @since 4.0.0
10
 *
11
 * @package Redaxscript
12
 * @category Tests
13
 * @author Henry Ruhs
14
 */
15
16
class ContentTest extends TestCaseAbstract
17
{
18
	/**
19
	 * testTitle
20
	 *
21
	 * @since 4.0.0
22
	 */
23
24
	public function testTitle() : void
25
	{
26
		/* expect and actual */
27
28
		$expect = $this->_language->get('home') . ' - ' . $this->_language->get('name', '_package');
29
		$actual = $this->_driver->getTitle();
30
31
		/* compare */
32
33
		$this->assertEquals($expect, $actual);
34
	}
35
36
	/**
37
	 * testLayout
38
	 *
39
	 * @since 4.0.0
40
	 */
41
42
	public function testLayout() : void
43
	{
44
		/* setup */
45
46
		$headerElement = $this->_driver->findElement(WebDriverBy::id('header'));
47
		$mainElement = $this->_driver->findElement(WebDriverBy::id('main'));
48
		$contentElement = $this->_driver->findElement(WebDriverBy::id('content'));
49
		$sidebarElement = $this->_driver->findElement(WebDriverBy::id('sidebar'));
50
		$footerElement = $this->_driver->findElement(WebDriverBy::id('footer'));
51
52
		/* compare */
53
54
		$this->assertTrue($headerElement->isDisplayed());
55
		$this->assertTrue($mainElement->isDisplayed());
56
		$this->assertTrue($contentElement->isDisplayed());
57
		$this->assertTrue($sidebarElement->isDisplayed());
58
		$this->assertTrue($footerElement->isDisplayed());
59
	}
60
}
61