Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
feat(visual-grid-client): added referrer to openEyes and ctr
Browse files Browse the repository at this point in the history
  • Loading branch information
danielschwartz85 committed Sep 11, 2019
1 parent aaa6828 commit 5906063
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/visual-grid-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@applitools/visual-grid-client",
"version": "12.28.4",
"version": "12.29.0",
"description": "",
"keywords": [
"applitools",
Expand Down
13 changes: 7 additions & 6 deletions packages/visual-grid-client/src/sdk/openEyes.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function makeOpenEyes({
compareWithParentBranch: _compareWithParentBranch,
ignoreBaseline: _ignoreBaseline,
userAgent: _userAgent,
referrer: _referrer,
createRGridDOMAndGetResourceMapping: _createRGridDOMAndGetResourceMapping,
apiKey,
proxy,
Expand All @@ -59,6 +60,7 @@ function makeOpenEyes({
displayName,
wrappers,
userAgent = _userAgent,
referrer = _referrer,
appName = _appName,
browser = _browser,
saveDebugData = _saveDebugData,
Expand Down Expand Up @@ -165,12 +167,11 @@ function makeOpenEyes({
let checkWindowPromises = wrappers.map(() => Promise.resolve());
const testController = makeTestContorler({testName, numOfTests: wrappers.length, logger});

const createRGridDOMAndGetResourceMapping = userAgent
? async args =>
_createRGridDOMAndGetResourceMapping(
Object.assign({fetchOptions: {headers: {'User-Agent': userAgent}}}, args),
)
: _createRGridDOMAndGetResourceMapping;
const headers = {'User-Agent': userAgent, Referer: referrer};
const createRGridDOMAndGetResourceMapping =
headers['User-Agent'] || headers['Referer']
? arg => _createRGridDOMAndGetResourceMapping(Object.assign({fetchOptions: {headers}}, arg))
: _createRGridDOMAndGetResourceMapping;

const checkWindow = makeCheckWindow({
testController,
Expand Down
2 changes: 2 additions & 0 deletions packages/visual-grid-client/src/sdk/renderingGridClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function makeRenderingGridClient({
agentId,
fetchResourceTimeout = 120000,
userAgent,
referrer,
}) {
const openEyesConcurrency = Number(concurrency);

Expand Down Expand Up @@ -170,6 +171,7 @@ function makeRenderingGridClient({
eyesTransactionThroat,
agentId,
userAgent,
referrer,
});

return {
Expand Down

0 comments on commit 5906063

Please sign in to comment.