test: instructor when creating course

This commit is contained in:
Jannat Patel
2024-06-26 09:33:03 +05:30
parent b18a3cb5e1
commit 5e91553190
2 changed files with 14 additions and 2 deletions

View File

@@ -2,7 +2,6 @@ describe("Course Creation", () => {
it("creates a new course", () => {
cy.login();
cy.wait(1000);
cy.visit("/lms/courses");
// Create a course
@@ -33,7 +32,11 @@ describe("Course Creation", () => {
.type("https://www.youtube.com/embed/-LPmw2Znl2c");
cy.get("[id=tags]").type("Learning{enter}Frappe{enter}ERPNext{enter}");
cy.get(".search-input").click();
cy.get("[id^=headlessui-combobox-option-").first().click();
cy.wait(1000);
cy.get("[id^=headlessui-combobox-option-")
.should("be.visible")
.first()
.click();
cy.get("label").contains("Published").click();
cy.get("label").contains("Published On").type("2021-01-01");
cy.button("Save").click();

View File

@@ -40,6 +40,15 @@ Cypress.Commands.add("login", (email, password) => {
});
});
Cypress.Commands.add("get_logged_user", () => {
cy.request({
url: "/api/method/frappe.auth.get_logged_user",
}).then((resp) => {
alert(resp);
return resp.message;
});
});
Cypress.Commands.add("button", (text) => {
return cy.get(`button:contains("${text}")`);
});