This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33411 from raylin/1219674-test-email-keyboard-gij
1219674 test email keyboard gij
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* global suite */ | ||
|
||
'use strict'; | ||
|
||
var KeyboardTestApp = require('./lib/keyboard_test_app'), | ||
Keyboard = require('./lib/keyboard'), | ||
assert = require('assert'); | ||
|
||
marionette('Email keyboard input tests', function() { | ||
var apps = {}; | ||
var keyboardTestApp = null; | ||
var keyboard = null; | ||
var client = null; | ||
|
||
apps[KeyboardTestApp.ORIGIN] = __dirname + '/keyboardtestapp'; | ||
|
||
client = marionette.client({ | ||
profile: { | ||
apps: apps, | ||
prefs: { | ||
'focusmanager.testmode': true | ||
}, | ||
settings: { | ||
'lockscreen.enabled': false, | ||
'ftu.manifestURL': null | ||
} | ||
} | ||
}); | ||
|
||
setup(function() { | ||
keyboard = new Keyboard(client); | ||
keyboardTestApp = new KeyboardTestApp(client); | ||
|
||
keyboardTestApp.launch(); | ||
}); | ||
|
||
suite('<input type="email"> tests', function() { | ||
setup(function() { | ||
keyboardTestApp.switchTo(); | ||
keyboardTestApp.emailInput.tap(); | ||
|
||
keyboard.switchTo(); | ||
}); | ||
|
||
test('should be email layout', function() { | ||
var atSymbol = '@'; | ||
var commaSymbol = ','; | ||
|
||
assert.equal(keyboard.isKeyPresent(atSymbol), true); | ||
|
||
assert.equal(keyboard.isKeyPresent(commaSymbol), false); | ||
}); | ||
|
||
test('Type post@mydomain.com', function() { | ||
keyboard.type('post'); | ||
|
||
keyboardTestApp.switchTo(); | ||
keyboardTestApp.emailInput.tap(); | ||
keyboard.switchTo(); | ||
|
||
keyboard.type('@'); | ||
keyboard.type('mydomain.com'); | ||
|
||
keyboardTestApp.switchTo(); | ||
|
||
assert.equal( | ||
keyboardTestApp.emailInput.getAttribute('value'), 'post@mydomain.com'); | ||
}); | ||
|
||
test('Type post123@mydomain.com', function() { | ||
keyboard.type('post123'); | ||
keyboard.type('@'); | ||
keyboard.type('mydomain.com'); | ||
|
||
keyboardTestApp.switchTo(); | ||
|
||
assert.equal( | ||
keyboardTestApp.emailInput.getAttribute('value'), | ||
'post123@mydomain.com'); | ||
}); | ||
|
||
}); | ||
}); |