Completed
Push — master ( 80c64b...cf3f21 )
by Robbie
11s
created

FeatureContext::iClickOnTheFirstVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace SilverStripe\VersionedAdmin\Tests\Behat\Context;
3
4
use SilverStripe\BehatExtension\Context\SilverStripeContext;
0 ignored issues
show
Bug introduced by
The type SilverStripe\BehatExtens...ext\SilverStripeContext was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
6
class FeatureContext extends SilverStripeContext
7
{
8
    /**
9
     * @Then I should see a list of versions
10
     */
11
    public function iShouldSeeAListOfVersions()
12
    {
13
        $page = $this->getSession()->getPage();
14
        $versionsTable = $page->find('css', '.history-viewer .table');
15
        assertNotNull($versionsTable, 'I should see a list of versions');
16
    }
17
18
    /**
19
     * @When I click on the first version
20
     */
21
    public function iClickOnTheFirstVersion()
22
    {
23
        $page = $this->getSession()->getPage();
24
        $firstVersion = $page->find('css', '.history-viewer .table tbody tr');
25
        assertNotNull($firstVersion, 'I should see a list of versions');
26
27
        $firstVersion->click();
28
29
        // Wait for the form builder to load
30
        $this->getSession()->wait(3000);
31
    }
32
}
33