refined-raincoat-56329
10/19/2022, 4:03 PMmysterious-belgium-25713
10/19/2022, 4:09 PMmysterious-belgium-25713
10/19/2022, 4:12 PMrefined-raincoat-56329
10/19/2022, 4:14 PMrefined-raincoat-56329
10/19/2022, 4:16 PM{
import SignInPage from '../../pages/signInPage.cy'
import ValidateAccountPage from '../../pages/validateAccountPage.cy'
import DeleteAccount from '../../pages/deleteAccount.cy'
type NewAccountCredentials = {
username: string,
password: string,
vcode: number,
uid: string
};
const clientUrl = "http://54.39.177.218:8080";
const serverUrl = "http://54.39.177.218:3020/api/v2";
const signIn = new SignInPage()
const validateAccount = new ValidateAccountPage()
const deleteAccount = new DeleteAccount()
describe('Smoke test', () => {
let credentials
let value
beforeEach(() => {
cy.viewport(390, 844);
cy.fixture('addDebtDetails')
.then((data) => value = data)
// create a new non-validated account in the back-end
cy.request(serverUrl + '/test-accounts/free')
.then(response => {
expect(response.body).to.have.property("username");
credentials = response.body;
})
cy.visit(clientUrl, {
onBeforeLoad: (win) => {
win.sessionStorage.clear();
win.localStorage.clear();
}
});
});
afterEach(() => {
/* CLEANUP AFTER EACH TEST */
deleteAccount.DeleteAccountMethod(credentials.password)
cy.wait(3000)
// must always delete the created account even if any of the above testing fails
cy.request("DELETE", `${serverUrl}/test-accounts/uid/${credentials.uid}`)
.then(response => {
expect(response.status).to.be.equal(200);
})
})
it('verifying a new user is able to login followed by validation being performed', () => {
// sign-in
signIn.SignInMethod(credentials.username, credentials.password)
// validate account
validateAccount.validateAccountMethod(credentials.vcode.toString())
cy.wait(3000)
// verify that we are on the home page and see the correct greeting and workspace name
cy.get("app-greeting h3").should('have.text', 'Hi QA Test! Primary');
})
})}
user
10/19/2022, 4:42 PMlimited-actor-4522
10/19/2022, 5:06 PMwitty-army-1426
10/19/2022, 5:18 PMrhythmic-lizard-86607
10/19/2022, 7:02 PMable-winter-6291
10/19/2022, 7:07 PMthousands-gpu-36872
10/19/2022, 8:46 PMstraight-kilobyte-77939
10/19/2022, 8:59 PMambitious-eye-55281
10/19/2022, 9:02 PMrefined-raincoat-56329
10/20/2022, 3:19 AMearly-dinner-41351
10/20/2022, 7:23 AMmysterious-belgium-25713
10/20/2022, 8:44 AMjs
describe('empty spec', () => {
beforeEach(() => {
cy.log("before Each")
});
it('passes', () => {
cy.visit('https://example.cypress.io')
cy.get("a").contains("getaaa")
})
afterEach(() => {
cy.log("I will delete stuff because the test failed")
});
})
Other than that i dont know if your file is correct but did you add 1 extra bracket that is surrounding the full file?mysterious-belgium-25713
10/20/2022, 9:00 AMlemon-animal-16490
10/20/2022, 9:52 AMstocky-appointment-62574
10/20/2022, 11:04 AMgray-kilobyte-89541
10/20/2022, 11:30 AMhandsome-lion-1748
10/20/2022, 11:32 AMArgument of type '"login"' is not assignable to parameter of type 'keyof Chainable '.
handsome-lion-1748
10/20/2022, 11:33 AMhandsome-lion-1748
10/20/2022, 11:33 AMhandsome-lion-1748
10/20/2022, 11:34 AMhandsome-lion-1748
10/20/2022, 11:40 AMdeclare global {
namespace Cypress {
interface Chainable {
login(email: string, password: string): Chainable<void>
}
}
}
and the error disappearedpowerful-orange-86819
10/20/2022, 11:56 AMjs
Cypress._.each(["samsung-s10", "428, 926"], (viewport) => {
})
handsome-lion-1748
10/20/2022, 12:06 PMcy.login
is not a function, I have an empty export {} in the end of the commands.ts file, should I add something to it? I couldn't find anything in the docshandsome-lion-1748
10/20/2022, 12:16 PMTS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.
handsome-lion-1748
10/20/2022, 12:29 PMdeclare namespace Cypress {
interface Chainable<Subject> {
login(email: string, password: string): Chainable<void>
}
}
and now I'm getting error on declare
TS1208: 'commands.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.