Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

env_spec.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const helpers = require("./global-setup");
  2. describe("Electron app environment", function () {
  3. helpers.setupTimeout(this);
  4. let app = null;
  5. beforeAll(function () {
  6. // Set config sample for use in test
  7. process.env.MM_CONFIG_FILE = "tests/configs/env.js";
  8. });
  9. beforeEach(function () {
  10. return helpers
  11. .startApplication({
  12. args: ["js/electron.js"]
  13. })
  14. .then(function (startedApp) {
  15. app = startedApp;
  16. });
  17. });
  18. afterEach(function () {
  19. return helpers.stopApplication(app);
  20. });
  21. it("should open a browserwindow", async function () {
  22. await app.client.waitUntilWindowLoaded();
  23. app.browserWindow.focus();
  24. expect(await app.client.getWindowCount()).toBe(1);
  25. expect(await app.browserWindow.isMinimized()).toBe(false);
  26. expect(await app.browserWindow.isDevToolsOpened()).toBe(false);
  27. expect(await app.browserWindow.isVisible()).toBe(true);
  28. expect(await app.browserWindow.isFocused()).toBe(true);
  29. const bounds = await app.browserWindow.getBounds();
  30. expect(bounds.width).toBeGreaterThan(0);
  31. expect(bounds.height).toBeGreaterThan(0);
  32. expect(await app.browserWindow.getTitle()).toBe("MagicMirror²");
  33. });
  34. });