Skip to content

Commit

Permalink
Merge pull request #747 from gemini-testing/chore/rm.mocha.mentions
Browse files Browse the repository at this point in the history
chore: remove outdated mocha references
  • Loading branch information
j0tunn committed Mar 24, 2023
2 parents 625f243 + c5ce005 commit 147659d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ it('test1', async ({ browser }) => {
```

#### Execution context
The execution context can be accessed by the `browser.executionContext` property, which contains the current test/hook mocha object extended with the browser id.
The execution context can be accessed by the `browser.executionContext` property, which contains the current test/hook object extended with the browser id.

Example:
```js
Expand Down
3 changes: 1 addition & 2 deletions src/browser/commands/assert-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const Image = require("../../../image");
const ScreenShooter = require("../../screen-shooter");
const temp = require("../../../temp");
const { getCaptureProcessors } = require("./capture-processors");
const { getTestContext } = require("../../../utils/mocha");
const RuntimeConfig = require("../../../config/runtime-config");
const AssertViewResults = require("./assert-view-results");
const BaseStateError = require("./errors/base-state-error");
Expand Down Expand Up @@ -60,7 +59,7 @@ module.exports = browser => {
const currSize = await currImgInst.getSize();
const currImg = { path: temp.path(Object.assign(tempOpts, { suffix: ".png" })), size: currSize };

const test = getTestContext(session.executionContext);
const test = session.executionContext.ctx.currentTest;
const refImg = { path: config.getScreenshotPath(test, state), size: null };
const { emitter } = browser;

Expand Down
5 changes: 0 additions & 5 deletions src/utils/mocha.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/src/browser/commands/assert-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("assertView command", () => {
};

const initBrowser_ = ({ browser = stubBrowser_(), session = mkSessionStub_() } = {}) => {
session.executionContext = { hermioneCtx: {} };
session.executionContext = { hermioneCtx: {}, ctx: {} };
sandbox.stub(webdriverio, "attach").resolves(session);

return browser.init({ sessionId: session.sessionId, sessionCaps: session.capabilities });
Expand Down

0 comments on commit 147659d

Please sign in to comment.