|
21 | 21 |
|
22 | 22 | module Selenium
|
23 | 23 | module WebDriver
|
24 |
| - describe Options do |
25 |
| - not_compliant_on browser: [:firefox, :ie, :edge] do |
26 |
| - describe 'logs' do |
27 |
| - compliant_on driver: :remote do |
28 |
| - it 'can fetch remote log types' do |
29 |
| - expect(driver.manage.logs.available_types).to include(:server, :client) |
| 24 | + # Safari bug - no logs or cookies |
| 25 | + not_compliant_on browser: :safari do |
| 26 | + describe Options do |
| 27 | + not_compliant_on browser: [:firefox, :ie, :edge] do |
| 28 | + describe 'logs' do |
| 29 | + compliant_on driver: :remote do |
| 30 | + it 'can fetch remote log types' do |
| 31 | + expect(driver.manage.logs.available_types).to include(:server, :client) |
| 32 | + end |
30 | 33 | end
|
31 |
| - end |
32 | 34 |
|
33 |
| - # Phantomjs Returns har instead of driver |
34 |
| - not_compliant_on browser: :phantomjs do |
35 |
| - it 'can fetch available log types' do |
36 |
| - expect(driver.manage.logs.available_types).to include(:browser, :driver) |
| 35 | + # Phantomjs Returns har instead of driver |
| 36 | + not_compliant_on browser: :phantomjs do |
| 37 | + it 'can fetch available log types' do |
| 38 | + expect(driver.manage.logs.available_types).to include(:browser, :driver) |
| 39 | + end |
37 | 40 | end
|
38 |
| - end |
39 | 41 |
|
40 |
| - # All other browsers show empty |
41 |
| - compliant_on browser: [:firefox, :ff_legacy] do |
42 |
| - it 'can get the browser log' do |
43 |
| - driver.navigate.to url_for('simpleTest.html') |
| 42 | + # All other browsers show empty |
| 43 | + compliant_on browser: [:firefox, :ff_legacy] do |
| 44 | + it 'can get the browser log' do |
| 45 | + driver.navigate.to url_for('simpleTest.html') |
44 | 46 |
|
45 |
| - entries = driver.manage.logs.get(:browser) |
46 |
| - expect(entries).not_to be_empty |
47 |
| - expect(entries.first).to be_kind_of(LogEntry) |
| 47 | + entries = driver.manage.logs.get(:browser) |
| 48 | + expect(entries).not_to be_empty |
| 49 | + expect(entries.first).to be_kind_of(LogEntry) |
| 50 | + end |
48 | 51 | end
|
49 |
| - end |
50 | 52 |
|
51 |
| - # Phantomjs Returns har instead of driver |
52 |
| - not_compliant_on browser: :phantomjs do |
53 |
| - it 'can get the driver log' do |
54 |
| - driver.navigate.to url_for('simpleTest.html') |
| 53 | + # Phantomjs Returns har instead of driver |
| 54 | + not_compliant_on browser: :phantomjs do |
| 55 | + it 'can get the driver log' do |
| 56 | + driver.navigate.to url_for('simpleTest.html') |
55 | 57 |
|
56 |
| - entries = driver.manage.logs.get(:driver) |
57 |
| - expect(entries).not_to be_empty |
58 |
| - expect(entries.first).to be_kind_of(LogEntry) |
| 58 | + entries = driver.manage.logs.get(:driver) |
| 59 | + expect(entries).not_to be_empty |
| 60 | + expect(entries.first).to be_kind_of(LogEntry) |
| 61 | + end |
59 | 62 | end
|
60 | 63 | end
|
61 | 64 | end
|
62 |
| - end |
63 | 65 |
|
64 |
| - not_compliant_on browser: :phantomjs do |
65 |
| - describe 'cookie management' do |
66 |
| - it 'should get all' do |
67 |
| - driver.navigate.to url_for('xhtmlTest.html') |
68 |
| - driver.manage.add_cookie name: 'foo', value: 'bar' |
| 66 | + not_compliant_on browser: :phantomjs do |
| 67 | + describe 'cookie management' do |
| 68 | + it 'should get all' do |
| 69 | + driver.navigate.to url_for('xhtmlTest.html') |
| 70 | + driver.manage.add_cookie name: 'foo', value: 'bar' |
69 | 71 |
|
70 |
| - cookies = driver.manage.all_cookies |
| 72 | + cookies = driver.manage.all_cookies |
71 | 73 |
|
72 |
| - expect(cookies.size).to eq(1) |
73 |
| - expect(cookies.first[:name]).to eq('foo') |
74 |
| - expect(cookies.first[:value]).to eq('bar') |
75 |
| - end |
| 74 | + expect(cookies.size).to eq(1) |
| 75 | + expect(cookies.first[:name]).to eq('foo') |
| 76 | + expect(cookies.first[:value]).to eq('bar') |
| 77 | + end |
76 | 78 |
|
77 |
| - # Edge BUG - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5751773/ |
78 |
| - not_compliant_on browser: :edge do |
79 |
| - it 'should delete one' do |
80 |
| - driver.navigate.to url_for('xhtmlTest.html') |
81 |
| - driver.manage.add_cookie name: 'foo', value: 'bar' |
| 79 | + # Edge BUG - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5751773/ |
| 80 | + not_compliant_on browser: :edge do |
| 81 | + it 'should delete one' do |
| 82 | + driver.navigate.to url_for('xhtmlTest.html') |
| 83 | + driver.manage.add_cookie name: 'foo', value: 'bar' |
82 | 84 |
|
83 |
| - driver.manage.delete_cookie('foo') |
| 85 | + driver.manage.delete_cookie('foo') |
| 86 | + end |
84 | 87 | end
|
85 |
| - end |
86 | 88 |
|
87 |
| - # Edge BUG - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5751773/ |
88 |
| - not_compliant_on browser: :edge do |
89 |
| - it 'should delete all' do |
90 |
| - driver.navigate.to url_for('xhtmlTest.html') |
| 89 | + # Edge BUG - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5751773/ |
| 90 | + not_compliant_on browser: :edge do |
| 91 | + it 'should delete all' do |
| 92 | + driver.navigate.to url_for('xhtmlTest.html') |
91 | 93 |
|
92 |
| - driver.manage.add_cookie name: 'foo', value: 'bar' |
93 |
| - driver.manage.delete_all_cookies |
94 |
| - expect(driver.manage.all_cookies).to be_empty |
| 94 | + driver.manage.add_cookie name: 'foo', value: 'bar' |
| 95 | + driver.manage.delete_all_cookies |
| 96 | + expect(driver.manage.all_cookies).to be_empty |
| 97 | + end |
95 | 98 | end
|
96 |
| - end |
97 | 99 |
|
98 |
| - # Firefox - https://bugzilla.mozilla.org/show_bug.cgi?id=1256007 |
99 |
| - not_compliant_on browser: [:safari, :firefox] do |
100 |
| - it 'should use DateTime for expires' do |
101 |
| - driver.navigate.to url_for('xhtmlTest.html') |
| 100 | + # Firefox - https://bugzilla.mozilla.org/show_bug.cgi?id=1256007 |
| 101 | + not_compliant_on browser: :firefox do |
| 102 | + it 'should use DateTime for expires' do |
| 103 | + driver.navigate.to url_for('xhtmlTest.html') |
102 | 104 |
|
103 |
| - expected = DateTime.new(2039) |
104 |
| - driver.manage.add_cookie name: 'foo', |
105 |
| - value: 'bar', |
106 |
| - expires: expected |
| 105 | + expected = DateTime.new(2039) |
| 106 | + driver.manage.add_cookie name: 'foo', |
| 107 | + value: 'bar', |
| 108 | + expires: expected |
107 | 109 |
|
108 |
| - actual = driver.manage.cookie_named('foo')[:expires] |
109 |
| - expect(actual).to be_kind_of(DateTime) |
110 |
| - expect(actual).to eq(expected) |
| 110 | + actual = driver.manage.cookie_named('foo')[:expires] |
| 111 | + expect(actual).to be_kind_of(DateTime) |
| 112 | + expect(actual).to eq(expected) |
| 113 | + end |
111 | 114 | end
|
112 | 115 | end
|
113 | 116 | end
|
114 |
| - end |
| 117 | + end # Options |
115 | 118 | end
|
116 | 119 | end # WebDriver
|
117 | 120 | end # Selenium
|
0 commit comments