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

feat: Create a landing page #108

Merged
merged 4 commits into from
Nov 19, 2022
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Good front for Home', () => {
it('Go to home', () => {
cy.visit('');
describe('Good front for Connection', () => {
it('Go to connection', () => {
cy.visit('/connection');
});

it('Good title', () => {
Expand All @@ -24,19 +24,19 @@ describe('Good front for Home', () => {
});
});

describe('Signup Button front in Home', () => {
it('Go to home', () => {
cy.visit('');
describe('Signup Button front in Connection', () => {
it('Go to connection', () => {
cy.visit('/connection');
});

it('Good URL redirect for create account button', () => {
cy.get('#ipc-home-create-account-button').click().url().should('eq', `${Cypress.config().baseUrl}/signup`);
});
});

describe('Login Button front in Home', () => {
it('Go to home', () => {
cy.visit('');
describe('Login Button front in Connection', () => {
it('Go to connection', () => {
cy.visit('/connection');
});

it('Good URL redirect for login button', () => {
Expand Down
54 changes: 54 additions & 0 deletions cypress/e2e/front/landing.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
describe('Good front for Landing', () => {
it('Go to landing', () => {
cy.visit('');
});

it ('Good text', () => {
cy.get('#ipc-landing-navbar-name').should('contain', 'Inter Planetary Cloud');
cy.get("#ipc-landing-headline").should('contain', 'The first distributed cloud unsealing your data.');
cy.get("#ipc-landing-subHeadline").should('contain', 'Build on top of Aleph, the next generation network of distributed big data applications.');
cy.get("#ipc-landing-services-title").should('contain', 'Inter Planetary Cloud offers two services');
cy.get("#ipc-landing-features-title").should('contain', 'Our Features');
})

it('Good text for features cards', () => {
cy.get("#ipc-landing-feature-upload-files").should('contain', 'Upload & Download Files');
cy.get("#ipc-landing-folder-management").should('contain', 'Folder Management');
cy.get("#ipc-landing-share-files").should('contain', 'Share Files');
cy.get("#ipc-landing-programs").should('contain', 'Upload & Run Programs');
cy.get("#ipc-landing-contact-management").should('contain', 'Contact Management');
})

it('Good text for services cards', () => {
cy.get("#ipc-landing-services-cloud-storage-title").should('contain', 'Cloud Storage');
cy.get("#ipc-landing-services-cloud-storage-description").should('contain', 'A distributed personal file storage and management system platform, protecting your data.');
cy.get('#ipc-landing-services-cloud-computing-title').should('contain', 'Cloud Computing');
cy.get('#ipc-landing-services-cloud-computing-description').should('contain', 'A distributed personal cloud computing platform for HTTP servers.');
});

it('Good text for start buttons', () => {
cy.get("#ipc-landing-heading-start-button").should('contain', 'Start the experiment');
cy.get("#ipc-landing-features-start-button").should('contain', 'Start the experiment');
})

it('Good number of elements', () => {
cy.get("button").should('have.length', 2);
cy.get('img').should('have.length', 13);
cy.get('#ipc-landing-services-cloud-storage').should('have.length', 1);
cy.get('#ipc-landing-services-cloud-computing').should('have.length', 1);
})
});

describe('Good redirect for Landing', () => {
beforeEach(() => {
cy.visit('');
});

it('Good redirection for heading button', () => {
cy.get("#ipc-landing-heading-start-button").click().url().should('eq', `${Cypress.config().baseUrl}/connection`);
});

it('Good redirection for features button', () => {
cy.get("#ipc-landing-features-start-button").click().url().should('eq', `${Cypress.config().baseUrl}/connection`);
});
});
26 changes: 26 additions & 0 deletions pages/connection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Button } from '@chakra-ui/react';
import Link from 'next/link';

import AuthPage from 'components/AuthPage';
import OutlineButton from 'components/OutlineButton';

const Connection = (): JSX.Element => (
<AuthPage
children={
<>
<Link href="/signup">
<Button variant="inline" w="100%" id="ipc-home-create-account-button">
Create an account
</Button>
</Link>
<Link href="/login">
<div style={{ width: '100%' }}>
<OutlineButton w="100%" id="ipc-home-login-button" text="Login" />
</div>
</Link>
</>
}
/>
);

export default Connection;
37 changes: 17 additions & 20 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import { Button } from '@chakra-ui/react';
import Link from 'next/link';
import { VStack } from '@chakra-ui/react';

import AuthPage from 'components/AuthPage';
import OutlineButton from 'components/OutlineButton';
import NavBar from 'components/landingPage/NavBar';
import HeadingSection from 'components/landingPage/HeadingSection';
import PartnersSection from 'components/landingPage/PartnersSection';
import ServicesSection from 'components/landingPage/ServicesSection';
import FeaturesSection from 'components/landingPage/FeaturesSection';
import Footer from 'components/landingPage/Footer';

const Home = (): JSX.Element => (
<AuthPage
children={
<>
<Link href="/signup">
<Button variant="inline" w="100%" id="ipc-home-create-account-button">
Create an account
</Button>
</Link>
<Link href="/login">
<div style={{ width: '100%' }}>
<OutlineButton w="100%" id="ipc-home-login-button" text="Login" />
</div>
</Link>
</>
}
/>
<VStack w="100%" spacing={{ base: '128px', lg: '256px' }} pt="64px" overflowY="hidden">
<NavBar />
<HeadingSection />
<VStack w="100%" spacing={{ base: '96px', lg: '128px' }}>
<PartnersSection />
<ServicesSection />
<FeaturesSection />
</VStack>
<Footer />
</VStack>
);

export default Home;
24 changes: 24 additions & 0 deletions public/assets/icons/cloud-computing-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions public/assets/icons/cloud-storage-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/assets/icons/code-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/assets/icons/contact-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading