Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
my-cucumbers-ru-github-io
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Лотуга Данила Сергеевич
my-cucumbers-ru-github-io
Commits
b63d42b8
Commit
b63d42b8
authored
Dec 17, 2013
by
Vadim Makeev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New tests, better naming
parent
89982372
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
11 deletions
+39
-11
Gruntfile.js
Gruntfile.js
+5
-2
inner-nav.js
tests/inner-nav.js
+10
-0
shortcuts.js
tests/shortcuts.js
+24
-9
No files found.
Gruntfile.js
View file @
b63d42b8
...
...
@@ -13,7 +13,10 @@ module.exports = function(grunt) {
},
dalek
:
{
test
:
{
src
:
'tests/keys.js'
src
:
[
'tests/shortcuts.js'
,
'tests/inner-nav.js'
]
}
}
});
...
...
@@ -21,6 +24,6 @@ module.exports = function(grunt) {
grunt
.
loadNpmTasks
(
'grunt-contrib-uglify'
);
grunt
.
loadNpmTasks
(
'grunt-dalek'
);
grunt
.
registerTask
(
'default'
,
[
'uglify'
,
'dalek'
]);
grunt
.
registerTask
(
'default'
,
[
'uglify'
]);
};
\ No newline at end of file
tests/inner-nav.js
0 → 100644
View file @
b63d42b8
module
.
exports
=
{
// Right
'Right Arrow key is switching .next to .active'
:
function
(
test
)
{
test
.
open
(
'themes/ribbon/index.html?full#20'
)
.
sendKeys
(
'body'
,
'
\
uE014'
)
// Right
.
assert
.
attr
(
'[id="20"] li:nth-child(2)'
,
'class'
,
'next active'
,
'First .next is .active'
)
.
done
();
}
};
\ No newline at end of file
tests/
key
s.js
→
tests/
shortcut
s.js
View file @
b63d42b8
...
...
@@ -3,16 +3,18 @@ module.exports = {
test
.
open
(
'themes/ribbon/index.html'
)
.
sendKeys
(
'body'
,
'
\
uE035'
)
// F5
.
assert
.
attr
(
'body'
,
'class'
,
'full'
)
.
assert
.
attr
(
'body'
,
'class'
,
'full'
,
'Mode is full'
)
.
done
();
},
// F5
'Body class is switching from `full` to `list` on F5'
:
function
(
test
)
{
test
.
open
(
'themes/ribbon/index.html?full'
)
.
sendKeys
(
'body'
,
'
\
uE035'
)
// F5
.
assert
.
attr
(
'body'
,
'class'
,
'list'
)
.
assert
.
attr
(
'body'
,
'class'
,
'list'
,
'Mode is list'
)
.
done
();
},
// Cmd Alt P — how to test multiple keys?
// 'Body class is switching from `list` to `full` on Cmd Alt P': function (test) {
// test
// .open('themes/ribbon/index.html')
...
...
@@ -20,32 +22,45 @@ module.exports = {
// .assert.attr('body', 'class', 'full')
// .done();
// },
// Esc
'Body class is switching from `full` to `list` on Esc'
:
function
(
test
)
{
test
.
open
(
'themes/ribbon/index.html?full'
)
.
sendKeys
(
'body'
,
'
\
uE00C'
)
// Esc
.
assert
.
attr
(
'body'
,
'class'
,
'list'
)
.
assert
.
attr
(
'body'
,
'class'
,
'list'
,
'Mode is list'
)
.
done
();
},
'End key works as expected'
:
function
(
test
)
{
// End
'End key select the last slide'
:
function
(
test
)
{
test
.
open
(
'themes/ribbon/index.html'
)
.
sendKeys
(
'body'
,
'
\
uE010'
)
// End
.
assert
.
attr
(
'.slide:last-of-type'
,
'class'
,
'slide active'
)
.
assert
.
attr
(
'.slide:last-of-type'
,
'class'
,
'slide active'
,
'Last slide is active'
)
.
done
();
},
'Home key works as expected'
:
function
(
test
)
{
// Home
'Home key select the first slide'
:
function
(
test
)
{
test
.
open
(
'themes/ribbon/index.html#20'
)
.
sendKeys
(
'body'
,
'
\
uE011'
)
// Home
.
assert
.
attr
(
'.slide:first-of-type'
,
'class'
,
'slide active'
)
.
assert
.
attr
(
'.slide:first-of-type'
,
'class'
,
'slide active'
,
'First slide is active'
)
.
done
();
},
'Enter is not opening slide if there’s no current'
:
function
(
test
)
{
// 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
)
{
test
.
open
(
'themes/ribbon/index.html'
)
.
sendKeys
(
'body'
,
'
\
uE007'
)
// Enter
.
assert
.
attr
(
'body'
,
'class'
,
'list'
)
.
assert
.
attr
(
'body'
,
'class'
,
'list'
,
'Mode is list'
)
.
done
();
}
// uE004 Tab
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment