E2E\SongListTest::testSelection PHP Метод

testSelection() публичный Метод

public testSelection ( )
    public function testSelection()
    {
        $this->loginAndWait()->repopulateList();
        // Single song selection
        static::assertContains('selected', $this->selectSong()->getAttribute('class'));
        // Shift+Click
        $this->selectRange();
        // should have 5 selected rows
        static::assertCount(5, $this->els('#queueWrapper tr.song-item.selected'));
        // Cmd+Click
        $this->cmdSelectSongs(2, 3);
        // should have only 3 selected rows remaining
        static::assertCount(3, $this->els('#queueWrapper tr.song-item.selected'));
        // 2nd and 3rd rows must not be selected
        static::assertNotContains('selected', $this->el('#queueWrapper tr.song-item:nth-child(2)')->getAttribute('class'));
        static::assertNotContains('selected', $this->el('#queueWrapper tr.song-item:nth-child(3)')->getAttribute('class'));
        // Delete key should remove selected songs
        $this->press(WebDriverKeys::DELETE)->waitUntil(function () {
            return count($this->els('#queueWrapper tr.song-item.selected')) === 0 && count($this->els('#queueWrapper tr.song-item')) === 7;
        });
        // Ctrl+A/Cmd+A should select all songs
        $this->selectAllSongs();
        static::assertCount(7, $this->els('#queueWrapper tr.song-item.selected'));
    }