2013-12-01 10:04:02 +04:00
|
|
|
|
module.exports = {
|
|
|
|
|
'Body class is switching from `list` to `full` on F5': function (test) {
|
|
|
|
|
test
|
|
|
|
|
.open('themes/ribbon/index.html')
|
|
|
|
|
.sendKeys('body', '\uE035') // F5
|
2013-12-18 03:53:22 +04:00
|
|
|
|
.assert.attr('body', 'class', 'full', 'Mode is full')
|
2013-12-01 10:04:02 +04:00
|
|
|
|
.done();
|
|
|
|
|
},
|
2013-12-18 03:53:22 +04:00
|
|
|
|
// F5
|
2013-12-01 10:04:02 +04:00
|
|
|
|
'Body class is switching from `full` to `list` on F5': function (test) {
|
|
|
|
|
test
|
|
|
|
|
.open('themes/ribbon/index.html?full')
|
|
|
|
|
.sendKeys('body', '\uE035') // F5
|
2013-12-18 03:53:22 +04:00
|
|
|
|
.assert.attr('body', 'class', 'list', 'Mode is list')
|
2013-12-01 10:04:02 +04:00
|
|
|
|
.done();
|
|
|
|
|
},
|
2013-12-18 03:53:22 +04:00
|
|
|
|
// Cmd Alt P — how to test multiple keys?
|
2013-12-01 10:04:02 +04:00
|
|
|
|
// 'Body class is switching from `list` to `full` on Cmd Alt P': function (test) {
|
|
|
|
|
// test
|
|
|
|
|
// .open('themes/ribbon/index.html')
|
|
|
|
|
// .sendKeys('body', '\uE03D\uE00A\u0050') // Cmd Alt P
|
|
|
|
|
// .assert.attr('body', 'class', 'full')
|
|
|
|
|
// .done();
|
|
|
|
|
// },
|
2013-12-18 03:53:22 +04:00
|
|
|
|
// Esc
|
2013-12-01 10:04:02 +04:00
|
|
|
|
'Body class is switching from `full` to `list` on Esc': function (test) {
|
|
|
|
|
test
|
|
|
|
|
.open('themes/ribbon/index.html?full')
|
|
|
|
|
.sendKeys('body', '\uE00C') // Esc
|
2013-12-18 03:53:22 +04:00
|
|
|
|
.assert.attr('body', 'class', 'list', 'Mode is list')
|
2013-12-01 10:04:02 +04:00
|
|
|
|
.done();
|
|
|
|
|
},
|
2013-12-18 03:53:22 +04:00
|
|
|
|
// End
|
|
|
|
|
'End key select the last slide': function (test) {
|
2013-12-01 10:04:02 +04:00
|
|
|
|
test
|
|
|
|
|
.open('themes/ribbon/index.html')
|
|
|
|
|
.sendKeys('body', '\uE010') // End
|
2013-12-18 03:53:22 +04:00
|
|
|
|
.assert.attr('.slide:last-of-type', 'class', 'slide active', 'Last slide is active')
|
2013-12-01 10:04:02 +04:00
|
|
|
|
.done();
|
|
|
|
|
},
|
2013-12-18 03:53:22 +04:00
|
|
|
|
// Home
|
|
|
|
|
'Home key select the first slide': function (test) {
|
2013-12-01 10:04:02 +04:00
|
|
|
|
test
|
|
|
|
|
.open('themes/ribbon/index.html#20')
|
|
|
|
|
.sendKeys('body', '\uE011') // Home
|
2013-12-18 03:53:22 +04:00
|
|
|
|
.assert.attr('.slide:first-of-type', 'class', 'slide active', 'First slide is active')
|
2013-12-01 10:04:02 +04:00
|
|
|
|
.done();
|
|
|
|
|
},
|
2013-12-18 03:53:22 +04:00
|
|
|
|
// Enter
|
|
|
|
|
'Enter is opening current slide': function (test) {
|
|
|
|
|
test
|
|
|
|
|
.open('themes/ribbon/index.html#1')
|
|
|
|
|
.sendKeys('body', '\uE007') // Enter
|
|
|
|
|
.assert.attr('body', 'class', 'full', 'Full mode')
|
|
|
|
|
.assert.attr('[id="1"]', 'class', 'slide active', 'Slide #1 is active')
|
|
|
|
|
.done();
|
|
|
|
|
},
|
|
|
|
|
// Enter
|
|
|
|
|
'Enter is not opening any slide if there’s no current': function (test) {
|
2013-12-01 10:04:02 +04:00
|
|
|
|
test
|
|
|
|
|
.open('themes/ribbon/index.html')
|
|
|
|
|
.sendKeys('body', '\uE007') // Enter
|
2013-12-18 03:53:22 +04:00
|
|
|
|
.assert.attr('body', 'class', 'list', 'Mode is list')
|
2013-12-01 10:04:02 +04:00
|
|
|
|
.done();
|
|
|
|
|
}
|
2013-12-02 19:07:05 +04:00
|
|
|
|
// uE004 Tab
|
|
|
|
|
// uE008 Shift
|
|
|
|
|
// uE00D Space
|
|
|
|
|
// uE00E PageUp
|
|
|
|
|
// uE00F PageDown
|
|
|
|
|
// uE012 Left
|
|
|
|
|
// uE013 Up
|
|
|
|
|
// uE014 Right
|
|
|
|
|
// uE015 Down
|
2013-12-01 10:04:02 +04:00
|
|
|
|
};
|