Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update login tests for new logics #965

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
amurKontur marked this conversation as resolved.
Show resolved Hide resolved

// 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,
});
amurKontur marked this conversation as resolved.
Show resolved Hide resolved
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 } });
amurKontur marked this conversation as resolved.
Show resolved Hide resolved
// 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
Loading