Merge branch 'maintenance' into devel

This commit is contained in:
GitHub Nightly Merge Action committed 2022-02-16 00:08:03 +00:00
commit 1697287693
8 files changed
+1279 -1966

No files matched your search

+3 -1
View File
@@ -6,5 +6,7 @@
"pluginsFile": "plugins/index.js",
"supportFile": "support/index.js",
"screenshotsFolder": "screenshots",
"videosFolder": "videos"
"videosFolder": "videos",
"modifyObstructiveCode": false,
"retries": 3
}
-2
View File
@@ -58,8 +58,6 @@ context("Login tests", () => {
context("Successful logout", () => {
it("logs out", () => {
Cypress.currentTest.retries(3);
// login
login(username, password);
+7 -3
View File
@@ -1,8 +1,9 @@
import {prepare_server, login, await_coreui} from "../util/util";
import {prepare_server, login, ensure_file_unknown, await_coreui} from "../util/util";
context("Upload tests", () => {
const username = "admin";
const password = "test";
const upload = "e2e-test.gcode";
beforeEach(() => {
prepare_server();
@@ -10,13 +11,16 @@ context("Upload tests", () => {
// login
login(username, password);
// clean up file if needed
ensure_file_unknown("local", upload);
cy.visit("/");
await_coreui();
});
it("uploads file to local via button", () => {
cy.get("[data-test-id=upload-local]").attachFile("e2e-test.gcode");
cy.get("[data-test-id=upload-local]").attachFile(upload);
cy.wait("@files");
cy.get("[data-test-id=files-list]").contains("e2e-test.gcode");
cy.get("[data-test-id=files-list]").contains(upload);
});
});
+1252 -1947
View File
File diff suppressed because it is too large. Load diff
+1 -2
View File
@@ -17,10 +17,9 @@
},
"homepage": "https://octoprint.org",
"dependencies": {
"cypress": "^4.12.0",
"cypress": "^9.4.1",
"cypress-commands": "^1.1.0",
"cypress-file-upload": "^4.0.7",
"cypress-plugin-retries": "^1.5.2",
"cypress-terminal-report": "^1.4.1",
"cypress-wait-until": "^1.7.1",
"ini": "^2.0.0"
-1
View File
@@ -19,5 +19,4 @@ module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
require("cypress-terminal-report/src/installLogsPrinter")(on);
require("cypress-plugin-retries/lib/plugin")(on);
};
-1
View File
@@ -21,4 +21,3 @@ import "./commands";
require("cypress-terminal-report/src/installLogsCollector")();
require("cypress-commands");
require("cypress-plugin-retries");
+16 -9
View File
@@ -1,13 +1,12 @@
export const prepare_server = () => {
cy.server();
cy.route("POST", "/api/login").as("login");
cy.route("POST", "/api/logout").as("logout");
cy.route("GET", "/api/settings").as("settings");
cy.route("GET", "/api/files?recursive=true").as("files");
cy.route("GET", "/plugin/softwareupdate/check").as("softwareupdate");
cy.route("GET", "/plugin/pluginmanager/plugins").as("pluginmanager");
cy.route("POST", "/api/connection").as("connectionCommand");
cy.route("GET", "/api/connection").as("connectionDetails");
cy.intercept("POST", "/api/login").as("login");
cy.intercept("POST", "/api/logout").as("logout");
cy.intercept("GET", "/api/settings").as("settings");
cy.intercept("GET", "/api/files?recursive=true").as("files");
cy.intercept("GET", "/plugin/softwareupdate/check").as("softwareupdate");
cy.intercept("GET", "/plugin/pluginmanager/plugins").as("pluginmanager");
cy.intercept("POST", "/api/connection").as("connectionCommand");
cy.intercept("GET", "/api/connection").as("connectionDetails");
};
export const await_loginui = () => {
@@ -63,3 +62,11 @@ export const disconnect = () => {
}
});
};
export const ensure_file_unknown = (location, name) => {
cy.request({
method: "DELETE",
url: `/api/files/${location}/${name}`,
failOnStatusCode: false
});
};