Giter Site home page Giter Site logo

Comments (5)

xupea avatar xupea commented on July 4, 2024

can you provide full code of your test case?

from spectron.

harshendrathakur avatar harshendrathakur commented on July 4, 2024

Hi @xupea ,

This is how app initialization and tests are maintained:
There is a setup file where app is initialized (file is called hooks.ts)
let app: Application;
export async function initializeApp() {
app = await new Application({
path: path.join(process.cwd(), getExecutablePath()),
chromeDriverArgs: [
"verbose",
"no-sandbox",
"disable-gpu",
"disable-dev-shm-usage",
],
waitTimeout: 15000,
});
return app;
}

export const getApp = async () => {
if (app && app.isRunning()) {
return app;
} else {
app = await initializeApp();
await app.start();
return app;
}
};

In my test file it is like this:

describe("App name", async function () {
let app: Application;
this.timeout(10000);

before(async () => {
app = await hooks.getApp();
await app.client.waitUntilWindowLoaded(15000); ----- Its failing at this step
});

it("Should launch single application window", async () => {
return await app.client.getWindowCount().should.eventually.equal(1);
});
});

Regards
Harshendra

from spectron.

harshendrathakur avatar harshendrathakur commented on July 4, 2024

Hi @xupea @zeke @durran @juliangruber , can you guys please help with this issue?

from spectron.

xupea avatar xupea commented on July 4, 2024

@harshendrathakur

you don't need to await new Application(...) operation, you had better try to run you e2e under this demo: https://github.com/electron-userland/spectron#usage

from spectron.

harshendrathakur avatar harshendrathakur commented on July 4, 2024

@xupea

Its not working even after removing the await from the new Application(...) operation.
Even if I remove the await app.client.waitUntilWindowLoaded(15000) statement from the before method. Some other test will fail where any wait conditions are are applied for example waitForExists or waitUntil. So, it failing for all the waits after upgrading to spectron 14.

from spectron.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.