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

OCT-2126 Projects E2E #612

Merged
merged 12 commits into from
Jan 16, 2025
29 changes: 9 additions & 20 deletions client/cypress/e2e/_17project.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {
changeMainValueToCryptoToggle,
// changeMainValueToFiat,
checkProjectsViewLoaded,
connectWallet,
mockCoinPricesServer,
visitWithLoader,
getHeartedProjectsIndicator,
checkHeartedProjectsIndicator,
} from 'cypress/utils/e2e';
import { getNamesOfProjects } from 'cypress/utils/projects';
import viewports from 'cypress/utils/viewports';
Expand Down Expand Up @@ -71,13 +72,13 @@ const checkProjectItemElements = (areMiddleSectionsVisible: boolean): Chainable<
.filter(':visible');

buttonShare.should('be.visible');
// buttonShare.click();
// cy.window().then(win => {
// buttonShare.click();
// win.navigator.clipboard.readText().then(text => {
// expect(text).to.eq(cy.url());
// });
// });
buttonShare.click();
cy.window().then(win => {
buttonShare.click();
win.navigator.clipboard.readText().then(text => {
expect(text).to.eq(cy.url());
});
});
projectListItemFirst
.get('[data-test=ProjectMilestonesNoResults]')
.scrollIntoView()
Expand All @@ -88,18 +89,6 @@ const checkProjectItemElements = (areMiddleSectionsVisible: boolean): Chainable<
.should('eq', 'Nothing to report yet. Check back again soon');
};

const getHeartedProjectsIndicator = (isNavbarVisible: boolean): Chainable<any> => {
return cy.get(
isNavbarVisible
? '[data-test=LayoutNavbar__numberOfAllocations]'
: '[data-test=LayoutTopBar__numberOfAllocations]',
);
};

const checkHeartedProjectsIndicator = (isNavbarVisible: boolean, number = 1): Chainable<any> => {
return getHeartedProjectsIndicator(isNavbarVisible).contains(number);
};

Object.values(viewports).forEach(
({ device, viewportWidth, viewportHeight, isMobile, isTablet }) => {
describe(`[AW IS OPEN] Project: ${device}`, { viewportHeight, viewportWidth }, () => {
Expand Down
Loading
Loading