Skip to content

Commit 7a88c9a

Browse files
committed
e2e testing
1 parent 07a5b41 commit 7a88c9a

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

test/e2e/scenarios.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,39 @@ describe('Angular Timer E2E Tests', function () {
1818
it("Simple Timer - Should stop ticking when user clicks 'Stop' button", function () {
1919
sleep(1);
2020
element('#basic-timer button:last-child').click();
21-
var originalValue = null;
22-
element('#basic-timer span').query(function (span, done) {
23-
originalValue = span.html();
21+
var oldValue = null;
22+
element('#basic-timer timer span').query(function (span, done) {
23+
oldValue = span.html();
2424
done();
2525
});
2626
sleep(1);
27-
element('#basic-timer span').query(function (span, done) {
28-
expect(value(originalValue)).toBe(span.html());
27+
element('#basic-timer timer span').query(function (span, done) {
28+
expect(value(oldValue)).toBe(span.html());
2929
done();
3030
});
3131
});
3232

3333
it('Simple Timer - Should reset timer value when user click on start button again', function () {
34-
sleep(1);
35-
var oldValue = element('#basic-timer span').text();
34+
sleep(2);
35+
var oldValue = element('#basic-timer timer span').text();
3636
element('#basic-timer button:nth-child(3)').click();
37-
element('#basic-timer button:last-child').click();
3837
expect(element('#basic-timer span').text()).toBeLessThan(oldValue);
3938
});
39+
40+
it('Clock Timer - with hours, minutes & seconds', function () {
41+
expect(element('#clock-timer timer').html()).toMatch(/0 hours,/);
42+
expect(element('#clock-timer timer').html()).toMatch(/0 minutes,/);
43+
expect(element('#clock-timer timer').html()).toMatch(/seconds./);
44+
});
45+
46+
it('Countdown Timer - Starts from 100', function () {
47+
expect(element('#countdown-timer timer').html()).toBeLessThan(100);
48+
});
49+
50+
it('Autostart False Timer - Init from 0', function () {
51+
expect(element('#auto-start-false-timer timer').html()).toBe('0');
52+
element('#auto-start-false-timer button:nth-child(3)').click();
53+
sleep(2);
54+
expect(element('#auto-start-false-timer timer').html()).toBeLessThan(100);
55+
});
4056
});

0 commit comments

Comments
 (0)