Commit 50596cb8 authored by Vadim Makeev's avatar Vadim Makeev

New basic tests, updated navigation and shortcuts

parent e4b79d06
module.exports = {
// --------------------------------
// Click
// --------------------------------
'Click on slide is switching from List to Full': function (test) {
test
.open('http://localhost:7497/tests/')
.click('[id="1"]')
.assert.attr('body', 'class').to.contain('full', 'Mode is Full')
.done();
},
// --------------------------------
// Walking
// --------------------------------
'All slides could be switched from first to last in List mode': function (test) {
test
.open('http://localhost:7497/tests/#1')
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.assert.attr('[id="6"]', 'class').to.contain('active', 'Last slide is Active')
.done();
},
'All slides could be switched from last to first in List mode': function (test) {
test
.open('http://localhost:7497/tests/#6')
.sendKeys('body', '\uE012') // Left
.sendKeys('body', '\uE012') // Left
.sendKeys('body', '\uE012') // Left
.sendKeys('body', '\uE012') // Left
.sendKeys('body', '\uE012') // Left
.assert.attr('[id="1"]', 'class').to.contain('active', 'First slide is Active')
.done();
},
'All slides could be switched from first to last in Full mode': function (test) {
test
.open('http://localhost:7497/tests/?full#1')
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.assert.attr('[id="6"]', 'class').to.contain('active', 'Last slide is Active')
.done();
},
'All slides could be switched from last to first in Full mode': function (test) {
test
.open('http://localhost:7497/tests/?full#6')
.sendKeys('body', '\uE012') // Left
.sendKeys('body', '\uE012') // Left
.sendKeys('body', '\uE012') // Left
.sendKeys('body', '\uE012') // Left
.sendKeys('body', '\uE012') // Left
.assert.attr('[id="1"]', 'class').to.contain('active', 'First slide is Active')
.done();
},
// --------------------------------
// Back
// --------------------------------
'Back is switching from Full to List': function (test) {
test
.open('http://localhost:7497/tests/')
.click('[id="1"]')
.back()
.assert.attr('body', 'class').to.contain('list', 'Mode is List')
.done();
},
// --------------------------------
// Zoom
// --------------------------------
'Back from Full to List is restoring scale': function (test) {
test
.open('http://localhost:7497/tests/')
.click('[id="1"]')
.back()
.assert.attr('body', 'style').to.contain('none', 'Scale is restored')
.done();
}
};
\ No newline at end of file
module.exports = {
'Navigation doesn’t work in List mode': function (test) {
test
.open('http://localhost:7497/tests/#5')
.sendKeys('body', '\uE014') // Right
.assert.attr('[id="6"]', 'class').to.contain('active', 'Next slide is Active')
.done();
},
'Right Arrow key is switching first Next item to Active': function (test) {
test
.open('http://localhost:7497/tests/?full#5')
......@@ -30,10 +37,10 @@ module.exports = {
test
.open('http://localhost:7497/tests/?full#5')
.sendKeys('body', '\uE014') // Right
.screenshot('tests/1.png')
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE014') // Right
.sendKeys('body', '\uE012') // Left
// Not sure why it’s failing. It works fine manually
.assert.attr('[id="4"]', 'class').to.contain('active', 'Previous slide is Active')
.done();
},
......
......@@ -6,14 +6,14 @@ module.exports = {
test
.open('http://localhost:7497/tests/')
.sendKeys('body', '\uE035') // F5
.assert.attr('body', 'class', 'full', 'Mode is Full')
.assert.attr('body', 'class').to.contain('full', 'Mode is Full')
.done();
},
'F5 is switching from Full to List': function (test) {
test
.open('http://localhost:7497/tests/?full')
.sendKeys('body', '\uE035') // F5
.assert.attr('body', 'class', 'list', 'Mode is List')
.assert.attr('body', 'class').to.contain('list', 'Mode is List')
.done();
},
// --------------------------------
......@@ -23,14 +23,14 @@ module.exports = {
test
.open('http://localhost:7497/tests/')
.sendKeys('body', '\uE03D\uE00A\u0070') // Cmd Alt P
.assert.attr('body', 'class', 'full', 'Mode is Full')
.assert.attr('body', 'class').to.contain('full', 'Mode is Full')
.done();
},
'Cmd Alt P keys are not switching from Full to List': function (test) {
test
.open('http://localhost:7497/tests/?full#1')
.sendKeys('body', '\uE03D\uE00A\u0070') // Cmd Alt P
.assert.attr('body', 'class', 'full', 'Mode is Full')
.assert.attr('body', 'class').to.contain('full', 'Mode is Full')
.done();
},
// --------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment