Skip to content

Commit

Permalink
Update login tests for new logics (#965)
Browse files Browse the repository at this point in the history
* test: fixes of login logics, screenshots updates

* test: updated more screenshots and made mcda input more like user
  • Loading branch information
amurKontur authored Jan 22, 2025
1 parent 0e63b26 commit c6f9383
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 9 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions e2e/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { getProjects } from './page-objects/helperBase.ts';

const projects = getProjects();

const linkToSurveyProd =
'https://docs.google.com/forms/d/e/1FAIpQLSe86tGwmJcIvs8aTc1-zyw6ihmXqIeObpeJZmd6y_fMGL70iA/viewform';

// Create a loop to loop over all the projects and create a test for everyone
for (const project of projects) {
test(`As Guest, I can log in to ${project.title}, check that this profile is mine, and log out`, async ({
Expand All @@ -24,12 +27,12 @@ for (const project of projects) {
await pageManager.atPricingPage.clickBtnAndAssertUrl({
context,
buttonName: 'Request trial',
expectedUrlPart: 'demo-call',
expectedUrlPart: project.env === 'test' ? 'demo-call' : linkToSurveyProd,
});
await pageManager.atPricingPage.clickBtnAndAssertUrl({
context,
buttonName: 'Book a demo',
expectedUrlPart: 'atlas-demo',
expectedUrlPart: project.env === 'test' ? 'atlas-demo' : linkToSurveyProd,
});
await pageManager.atNavigationMenu.clickButtonToOpenPage('Profile');
}
Expand Down
5 changes: 1 addition & 4 deletions e2e/page-objects/helperBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ export type Project = {
};

export class HelperBase {
readonly page: Page;
constructor(public readonly page: Page) {}

constructor(page: Page) {
this.page = page;
}
/**
* This method opens up a project like disaster-ninja, atlas, etc. After that it checks the title to correspond to this project and accepts cookies if needed
* @param project object with details about project to open like name, url, title, etc.
Expand Down
4 changes: 2 additions & 2 deletions e2e/page-objects/mcdaPopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class MCDAPopup extends HelperBase {
for (let i = 0; i < inputs.length; i++) {
// We should better get a new locator for each iteration
const layerInput = mcdaPopup.getByPlaceholder('Select layers');
await layerInput.pressSequentially(inputs[i], { delay: 50 });
await layerInput.pressSequentially(inputs[i], { delay: 90 });
// Wait for the list of layers to be visible
const listbox = mcdaPopup.getByRole('listbox');
await listbox.waitFor({ state: 'visible' });
Expand Down Expand Up @@ -113,7 +113,7 @@ export class MCDAPopup extends HelperBase {
saveButton,
'Check that after inputs save button is not disabled',
).not.toHaveAttribute('disabled');
await saveButton.click({ delay: 100 });
await saveButton.click({ delay: 100, position: { x: 15, y: 15 } });
// Wait for the popup to close
await mcdaPopup.waitFor({ state: 'hidden' });
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/page-objects/pricingPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class PricingPage extends HelperBase {
expect(this.page.getByText('Educational', { exact: true })).toBeVisible(),
expect(this.page.getByText('Custom', { exact: true })).toBeVisible(),
expect(this.page.getByText('Contact sales', { exact: true })).toBeVisible(),
plansAndPricingTexts.forEach((text) => expect(text).toBeVisible()),
plansAndPricingTexts.forEach((textEl) => expect(textEl).toBeVisible()),
expect(this.page.getByText('Save 5%', { exact: true })).toBeVisible(),
]);
}
Expand Down

0 comments on commit c6f9383

Please sign in to comment.