Skip to content

Commit 60134ce

Browse files
Mike Taylordeepthivenkat
Mike Taylor
authored andcommitted
Issue webcompat#1167. Add tests for optional validation.
1 parent 3aa5ccd commit 60134ce

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

tests/functional/reporting-non-auth.js

+28-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ define([
7474
.findByCssSelector('#url').click()
7575
.end()
7676
// wait a bit
77-
.then(FunctionalHelpers.visibleByQSA('.wc-Form-helpMessage'))
77+
.then(FunctionalHelpers.visibleByQSA('label[for=url] + span'))
7878
.findByXpath('//*[@id="js-ReportForm"]/div/form/div[1]/div[2]/div[1]').getAttribute('class')
7979
.then(function(className) {
8080
assert.include(className, 'js-form-error');
@@ -94,6 +94,33 @@ define([
9494
.end();
9595
},
9696

97+
'(optional) browser + os validation': function() {
98+
return this.remote
99+
.setFindTimeout(intern.config.wc.pageLoadTimeout)
100+
.get(require.toUrl(url + '?open=1'))
101+
.then(FunctionalHelpers.visibleByQSA('#browser'))
102+
// xpath to the #browser formGroup
103+
.findByXpath('//*[@id="js-ReportForm"]/div/form/div[1]/div[2]/div[2]').getAttribute('class')
104+
.then(function(className) {
105+
assert.include(className, 'js-no-error');
106+
assert.notInclude(className, 'js-form-error');
107+
})
108+
.end()
109+
.findByCssSelector('#browser').clearValue()
110+
.end()
111+
.findByCssSelector('#os').click()
112+
.end()
113+
// wait a bit
114+
.sleep(250)
115+
// xpath to the #browser formGroup
116+
.findByXpath('//*[@id="js-ReportForm"]/div/form/div[1]/div[2]/div[2]').getAttribute('class')
117+
.then(function(className) {
118+
assert.notInclude(className, 'js-form-error');
119+
assert.notInclude(className, 'js-no-error');
120+
})
121+
.end();
122+
},
123+
97124
'Problem type validation': function() {
98125
return this.remote
99126
.setFindTimeout(intern.config.wc.pageLoadTimeout)

0 commit comments

Comments
 (0)