mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-03 05:50:39 +08:00

* chore: video config is updated as it will not generate any video while running cypress * chore: cypress.env.json is added in the env file * chore: tsConfig is updated * feature: Cypress is updated with some of the test cases * chore: default test case is removed * chore: convertToNanoSecondsToSecond function is updated * chore: lock files, node_modules are ignored in git * test: metric are updated Co-authored-by: Ankit Nayan <ankit@signoz.io>
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import ROUTES from "constants/routes";
|
|
|
|
const Login = ({ email, name }: LoginProps): void => {
|
|
const emailInput = cy.findByPlaceholderText("mike@netflix.com");
|
|
|
|
emailInput.then((emailInput) => {
|
|
const element = emailInput[0];
|
|
// element is present
|
|
expect(element).not.undefined;
|
|
expect(element.nodeName).to.be.equal("INPUT");
|
|
});
|
|
emailInput.type(email).then((inputElements) => {
|
|
const inputElement = inputElements[0];
|
|
const inputValue = inputElement.getAttribute("value");
|
|
expect(inputValue).to.be.equals(email);
|
|
});
|
|
|
|
const firstNameInput = cy.findByPlaceholderText("Mike");
|
|
firstNameInput.then((firstNameInput) => {
|
|
const element = firstNameInput[0];
|
|
// element is present
|
|
expect(element).not.undefined;
|
|
expect(element.nodeName).to.be.equal("INPUT");
|
|
});
|
|
|
|
firstNameInput.type(name).then((inputElements) => {
|
|
const inputElement = inputElements[0];
|
|
const inputValue = inputElement.getAttribute("value");
|
|
expect(inputValue).to.be.equals(name);
|
|
});
|
|
|
|
const gettingStartedButton = cy.get("button");
|
|
gettingStartedButton.click();
|
|
|
|
cy.location("pathname").then((e) => {
|
|
expect(e).to.be.equal(ROUTES.APPLICATION);
|
|
});
|
|
};
|
|
|
|
export interface LoginProps {
|
|
email: string;
|
|
name: string;
|
|
}
|
|
|
|
export default Login;
|