Skip to content

Commit 7d4eb8a

Browse files
jamessnowplowPaul Boocock
authored andcommitted
Fix osx+safari testing setup issues (close #760)
1 parent fed9c66 commit 7d4eb8a

File tree

5 files changed

+45
-9
lines changed

5 files changed

+45
-9
lines changed

tests/functional/detectors.spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3232
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
*/
34-
34+
import F from 'lodash/fp'
3535
import moment from 'moment-timezone'
3636

3737
describe('Detectors test', () => {
@@ -59,7 +59,8 @@ describe('Detectors test', () => {
5959
})
6060

6161
it('Check localStorage availability', () => {
62-
expect($('#localStorageAccessible').getText()).toBe('true')
62+
const supportsLocalStorage = !F.isMatch( { version: '12603.3.8', browserName: 'safari' }, browser.capabilities)
63+
expect($('#localStorageAccessible').getText()).toBe(String(supportsLocalStorage))
6364
})
6465

6566
it('Check sessionStorage availability', () => {

tests/functional/helpers.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,19 @@
3131
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3232
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
*/
34+
import F from 'lodash/fp'
3435

3536
describe('Helpers test', () => {
37+
// I think failure on click handlers are related to the following, skipping on effected browser/os combo
38+
// https://support.saucelabs.com/hc/en-us/articles/115003957233-Safari-11-with-Selenium-3-x-not-Handling-Click-Events-on-Option-Elements
39+
if (
40+
F.isMatch(
41+
{ browserVersion: '13.0.1', 'safari:platformVersion': '10.13.6' },
42+
browser.capabilities
43+
)
44+
) {
45+
fit('skipping in safari 13 on osx 10.13 (webdriver issue)', () => {})
46+
}
3647

3748
it('Gets page title', () => {
3849
browser.url('/helpers.html')

tests/integration/integration.spec.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ const hasGeoContext = isMatchWithCB({
6868
})
6969

7070
describe('Test that request_recorder logs meet expectations', () => {
71+
if (
72+
F.isMatch(
73+
{ version: '12603.3.8', browserName: 'safari' },
74+
browser.capabilities
75+
)
76+
) {
77+
// the safari driver sauce uses for safari 10 doesnt support
78+
// setting cookies, so this whole suite fails
79+
// https://github.com/webdriverio/webdriverio/issues/2004
80+
fit('skipping in safari 10', () => {})
81+
return
82+
}
83+
7184
let log = []
7285
let container
7386
let containerUrl
@@ -88,7 +101,10 @@ describe('Test that request_recorder logs meet expectations', () => {
88101
})
89102
})
90103
browser.url('/index.html')
91-
browser.setCookies({ name: 'container', value: containerUrl })
104+
browser.setCookies({
105+
name: 'container',
106+
value: containerUrl,
107+
})
92108
browser.url('/integration.html')
93109
browser.pause(15000) // Time for requests to get written
94110
browser.call(() =>

tests/integration/sessionStorage.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ const isMatchWithCB = F.isMatchWith((lt, rt) =>
4242
)
4343

4444
describe('Test that request_recorder logs meet expectations', () => {
45+
if (
46+
F.isMatch(
47+
{ version: '12603.3.8', browserName: 'safari' },
48+
browser.capabilities
49+
)
50+
) {
51+
// the safari driver sauce uses for safari 10 doesnt support
52+
// setting cookies, so this whole suite fails
53+
// https://github.com/webdriverio/webdriverio/issues/2004
54+
fit('skipping in safari 10', () => {})
55+
return
56+
}
57+
4558
let log = []
4659
let container
4760
let containerUrl

tests/wdio.sauce.conf.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,24 @@ exports.config = {
5252
platformName: 'macOS 10.14',
5353
'sauce:options': { seleniumVersion: '3.14.0' },
5454
},
55-
/* this fails on a click handler in helpers.js
5655
{
5756
browserName: 'safari',
5857
browserVersion: '13.0',
5958
platformName: 'macOS 10.13',
6059
'sauce:options': { seleniumVersion: '3.14.0' },
6160
},
62-
*/
6361
{
6462
browserName: 'safari',
6563
browserVersion: '11.0',
6664
platformName: 'macOS 10.12',
6765
'sauce:options': { seleniumVersion: '3.14.0' },
6866
},
69-
/* this combo seems to have a problem with the cookie
70-
* approach to set collector endpoint. Might be one
71-
* we want to drop anyway
7267
{
7368
browserName: 'safari',
7469
platformName: 'macOS 10.12',
7570
browserVersion: '10.1',
7671
'sauce:options': { seleniumVersion: '3.14.0' },
77-
},*/
72+
},
7873
// and back to platform again
7974
{
8075
browserName: 'safari',

0 commit comments

Comments
 (0)