MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / expectRequest

Function expectRequest

javascript/webdriver/test/http/http_test.js:67–82  ·  view source on GitHub ↗
(method, path, data, headers)

Source from the content-addressed store, hash-verified

65}
66
67function expectRequest(method, path, data, headers) {
68 var description = method + ' ' + path + '\n' + headersToString(headers) +
69 '\n' + JSON.stringify(data);
70
71 return mockClient.send(new goog.testing.mockmatchers.ArgumentMatcher(
72 function(request) {
73 assertEquals('wrong method', method, request.method);
74 assertEquals('wrong path', path + '', request.path);
75 webdriver.test.testutil.assertObjectEquals(data, request.data);
76 assertNull(
77 'Wrong headers for request:\n' + description +
78 '\n Actual headers were:\n' + headersToString(request.headers),
79 goog.testing.asserts.findDifferences(headers, request.headers));
80 return true;
81 }, description));
82}
83
84function response(status, headers, body) {
85 return new webdriver.http.Response(status, headers, body);

Calls 2

headersToStringFunction · 0.70
sendMethod · 0.65

Tested by

no test coverage detected