import React from 'react';
import Button from 'antd/lib/button';
import { Link } from 'react-router-dom';
import Typography from 'antd/lib/typography';
import Icon from 'antd/lib/icon';
import { StorageType } from '../server/storage.typing';
import { getNewProjectRoute } from '../routes';
import { ProjectsPerRemote } from './ProjectsPerRemote';
import { useThisDoc } from '../doc/useDoc';
import { Info } from '../common/Info';
import { MAX_AGE } from '../auth/githubCookie';
export const Projects = () => {
useThisDoc(Doc);
return (
<>
Test-crawler is project based. To be able to start a crawler, you will first need to create a project by clicking on
Depending on how test-crawler is hosted, there will be different type of storage availble: local, GitHub, and more coming soon... If you are running it, yourself, all the storage should be available.
The local storage consist to save the data on the server where is hosted test-crawler. This is the best option to keep your tests private and safe.
The GitHub storage consist to save the data on a given repository. This option is good for public project, especially for open source project that are already on GitHub. It will give you the possibility to keep history of your tests in relation to your code changes. Also this storage is using GitHub CI workflow to generate your test, you can therefor integrate it very well with your other workflow.
To use GitHub storage, we need to provide a user and a personal access tokens to the GitHub API. Personal access tokens is a sensible information and you should keep it safe. For this reason, we are saving this token in your cookie only for a limited amount of time. After { MAX_AGE } min of inactivity, you will need to enter it again.
To keep this token safe, use some password manager like Lastpass or Bitwarden.
Alternatively, you can use the build-in token AES encryption. To decrypt the token
click on lock icon
To create a token, go in developer settings, personal access tokens and then generate
new token. In most of the case you will only need to give permission
for
Once your credential provided, you will need to select the repository where you want to save your tests. In general, it would make sense to save those tests in the same repository as the website you are testing. You can switch from one repository to the other at anytime.
> );