mammoth-animal-54787
07/08/2022, 5:34 PMmammoth-animal-54787
07/08/2022, 5:34 PMmammoth-animal-54787
07/08/2022, 5:34 PMmammoth-animal-54787
07/08/2022, 5:35 PMmammoth-animal-54787
07/08/2022, 5:35 PMmammoth-animal-54787
07/08/2022, 5:36 PMechoing-painting-40909
07/08/2022, 5:54 PMbut it was continuously found
.mammoth-animal-54787
07/08/2022, 6:02 PMmammoth-animal-54787
07/08/2022, 6:02 PMmammoth-animal-54787
07/08/2022, 6:02 PMmammoth-animal-54787
07/08/2022, 6:02 PMmammoth-animal-54787
07/08/2022, 6:02 PMmammoth-animal-54787
07/08/2022, 6:02 PMbetter-ghost-75015
07/08/2022, 6:14 PMmammoth-animal-54787
07/08/2022, 6:54 PMgray-kilobyte-89541
07/08/2022, 8:26 PMdamp-artist-40731
07/09/2022, 7:33 PMrich-pharmacist-74804
07/11/2022, 9:28 AMCypress.Commands.add('login', (userType, email) => {
cy.visit('/auth');
const types = {
admin: {
email: 'email',
password: 'password'
},
sales: {
email: 'email',
password: 'password'
},
newUser: {
email: email,
password: 'password'
}
};
const user = types[userType];
cy.dataCy('email').find('input').clear().type(user.email);
cy.dataCy('password').find('input').clear().type(user.password);
cy.btnName('login');
cy.notification('Signed in successfully');
cy.request({
method: 'POST',
url: Cypress.env('url'),
body: {
user: { email: user.email, password: user.password, recaptcha: null, remember_me: true }
}
}).then(data => {
const { headers } = data;
cy.storeData('token', `{
"token": "${headers.authorization}" ,
"name": "${data.body.data.attributes.name}",
"role": "${data.body.data.attributes.role_name}",
"userType": "${data.body.data.attributes.user_type}"
}`);
});
powerful-orange-86819
07/11/2022, 10:08 AMjs
Cypress.Commands.add("userLogin", (username, password) => {
const env = Cypress.env(); // THIS IS HOW I DELCARE env, then accesss it with env.something
Cypress.log({ Name: "Generating token for user: " + username });
const options = {
method: "POST",
url: env.apiUrl,
body: {
username,
password,
},
};
cy.request(options).then((response) => {
env.tokens[username] = response.body.access_token;
Cypress.env(env);
});
});
hallowed-florist-3643
07/11/2022, 11:10 AMbright-park-76512
07/11/2022, 11:58 AMfierce-judge-97877
07/11/2022, 12:37 PMhallowed-florist-3643
07/11/2022, 1:55 PMflaky-tiger-25074
07/11/2022, 2:39 PMflaky-tiger-25074
07/11/2022, 2:40 PMimport { defineConfig } from "cypress";
export default defineConfig({
e2e: {
baseUrl: "http://localhost:3000/#/",
},
});
flaky-tiger-25074
07/11/2022, 2:42 PMgray-kilobyte-89541
07/11/2022, 2:43 PMhttp://localhost:3000
?flaky-tiger-25074
07/11/2022, 2:44 PMrich-pharmacist-74804
07/12/2022, 6:06 AMbright-park-76512
07/12/2022, 7:21 AM