Home   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A navigateTo() 0 6 1
1
<?php
2
3
namespace Magium\Navigators;
4
5
use Magium\Actions\WaitForPageLoaded;
6
use Magium\Themes\BaseThemeInterface;
7
use Magium\WebDriver\WebDriver;
8
9
class Home implements StaticNavigatorInterface
10
{
11
12
    const NAVIGATOR = 'Home';
13
14
    protected $webDriver;
15
    protected $baseTheme;
16
    protected $loaded;
17
18
    /**
19
     * Home constructor.
20
     * @param $baseTheme
21
     * @param $webDriver
22
     */
23
    public function __construct(BaseThemeInterface $baseTheme, WebDriver $webDriver, WaitForPageLoaded $loaded)
24
    {
25
        $this->baseTheme = $baseTheme;
26
        $this->webDriver = $webDriver;
27
        $this->loaded = $loaded;
28
    }
29
30
31
    public function navigateTo()
32
    {
33
        $testElement = $this->webDriver->byXpath('//body');
34
        $this->webDriver->byXpath($this->baseTheme->getHomeXpath())->click();
35
        $this->loaded->execute($testElement);
36
    }
37
38
}