mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
fix: fix cypress error (#1817)
* fix: fix cypress error * fix: fix cypress error * fix: fix cypress error * fix: fix cypress error * fix: fix cypress error * fix: fix cypress error * fix: fix cypress error * fix: fix cypress error * fix: fix cypress error
This commit is contained in:
parent
cb542ae46a
commit
7df043fb15
@ -1,16 +1,14 @@
|
||||
describe('Test adapter', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
const selector = {
|
||||
add: ".ant-table-title > div > .ant-btn"
|
||||
};
|
||||
it("test adapter", () => {
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.visit("http://localhost:7001/adapters");
|
||||
cy.url().should("eq", "http://localhost:7001/adapters");
|
||||
cy.get(selector.add).click();
|
||||
cy.get(selector.add,{timeout:10000}).click();
|
||||
cy.url().should("include","http://localhost:7001/adapters/built-in/")
|
||||
});
|
||||
})
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test aplication', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test aplication", () => {
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test certs', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test certs", () => {
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test models', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test org", () => {
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test Orgnazition', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test org", () => {
|
||||
|
@ -1,16 +1,14 @@
|
||||
describe('Test payments', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
const selector = {
|
||||
add: ".ant-table-title > div > .ant-btn"
|
||||
};
|
||||
it("test payments", () => {
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.visit("http://localhost:7001/payments");
|
||||
cy.url().should("eq", "http://localhost:7001/payments");
|
||||
cy.get(selector.add).click();
|
||||
cy.get(selector.add,{timeout:10000}).click();
|
||||
cy.url().should("include","http://localhost:7001/payments/")
|
||||
});
|
||||
})
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test permissions', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test permissions", () => {
|
||||
|
@ -1,16 +1,14 @@
|
||||
describe('Test products', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
const selector = {
|
||||
add: ".ant-table-title > div > .ant-btn > span"
|
||||
};
|
||||
it("test products", () => {
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.visit("http://localhost:7001/products");
|
||||
cy.url().should("eq", "http://localhost:7001/products");
|
||||
cy.get(selector.add).click();
|
||||
cy.get(selector.add,{timeout:10000}).click();
|
||||
cy.url().should("include","http://localhost:7001/products/")
|
||||
});
|
||||
})
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test providers', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test providers", () => {
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test records', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test records", () => {
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test resource', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test resource", () => {
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test roles', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test role", () => {
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test sessions', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test sessions", () => {
|
||||
|
@ -1,16 +1,14 @@
|
||||
describe('Test syncers', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
const selector = {
|
||||
add: ".ant-table-title > div > .ant-btn"
|
||||
};
|
||||
it("test syncers", () => {
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.visit("http://localhost:7001/syncers");
|
||||
cy.url().should("eq", "http://localhost:7001/syncers");
|
||||
cy.get(selector.add).click();
|
||||
cy.get(selector.add,{timeout:10000}).click();
|
||||
cy.url().should("include","http://localhost:7001/syncers/")
|
||||
});
|
||||
})
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test sysinfo', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test sysinfo", () => {
|
||||
|
@ -1,16 +1,14 @@
|
||||
describe('Test tokens', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
const selector = {
|
||||
add: ".ant-table-title > div > .ant-btn"
|
||||
};
|
||||
it("test records", () => {
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.visit("http://localhost:7001/tokens");
|
||||
cy.url().should("eq", "http://localhost:7001/tokens");
|
||||
cy.get(selector.add).click();
|
||||
cy.get(selector.add,{timeout:10000}).click();
|
||||
cy.url().should("include","http://localhost:7001/tokens/")
|
||||
});
|
||||
})
|
||||
|
@ -1,6 +1,5 @@
|
||||
describe('Test User', () => {
|
||||
beforeEach(()=>{
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.login();
|
||||
})
|
||||
it("test user", () => {
|
||||
|
@ -7,10 +7,10 @@ describe('Test webhooks', () => {
|
||||
add: ".ant-table-title > div > .ant-btn"
|
||||
};
|
||||
it("test webhooks", () => {
|
||||
cy.visit("http://localhost:7001");
|
||||
|
||||
cy.visit("http://localhost:7001/webhooks");
|
||||
cy.url().should("eq", "http://localhost:7001/webhooks");
|
||||
cy.get(selector.add).click();
|
||||
cy.url().should("include","http://localhost:7001/webhooks/")
|
||||
cy.get(selector.add,{timeout:10000}).click();
|
||||
cy.url().should("include","http://localhost:7001/webhooks/");
|
||||
});
|
||||
})
|
||||
|
@ -23,19 +23,15 @@
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
const selector = {
|
||||
username: "#input",
|
||||
password: "#normal_login_password",
|
||||
loginButton: ".ant-btn",
|
||||
};
|
||||
Cypress.Commands.add('login', ()=>{
|
||||
cy.request({
|
||||
method: "POST",
|
||||
url: "http://localhost:7001/api/login",
|
||||
body: {
|
||||
"application": "app-built-in",
|
||||
"organization": "built-in",
|
||||
"username": "admin",
|
||||
"password": "123",
|
||||
"autoSignin": true,
|
||||
"type": "login",
|
||||
},
|
||||
}).then((Response) => {
|
||||
expect(Response).property("body").property("status").to.equal("ok");
|
||||
});
|
||||
cy.visit("http://localhost:7001");
|
||||
cy.get(selector.username).type("admin");
|
||||
cy.get(selector.password).type("123");
|
||||
cy.get(selector.loginButton).click();
|
||||
cy.url().should("eq", "http://localhost:7001/");
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user