Skip to content

Commit

Permalink
balance timings
Browse files Browse the repository at this point in the history
  • Loading branch information
john681611 committed Sep 19, 2023
1 parent f35459e commit d81c2aa
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions application/frontend/src/test/basic-e2etest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ describe('App.js', () => {

it('can search for random strs', async () => {
await page.goto('http://127.0.0.1:5000');
await page.waitForSelector('#SearchBar', { timeout: 1000 });
await page.waitForSelector('#SearchButton', { timeout: 1000 });
await page.waitForSelector('#SearchBar', { timeout: 10000 });
await page.waitForSelector('#SearchButton', { timeout: 10000 });
await page.type('#SearchBar > div > input', 'asdf');
await page.click('#SearchButton');
await page.waitForSelector('.content', { timeout: 10000 });
Expand All @@ -36,11 +36,11 @@ describe('App.js', () => {

it('can search for cryptography using the free text method and it returns both Nodes and CRES', async () => {
await page.goto('http://127.0.0.1:5000');
await page.waitForSelector('#SearchBar', { timeout: 1000 });
await page.waitForSelector('#SearchButton', { timeout: 1000 });
await page.waitForSelector('#SearchBar', { timeout: 10000 });
await page.waitForSelector('#SearchButton', { timeout: 10000 });
await page.type('#SearchBar > div > input', 'crypto');
await page.click('#SearchButton');
await page.waitForSelector('.content', { timeout: 1000 });
await page.waitForSelector('.content', { timeout: 10000 });
await page.waitForSelector('.standard-page__links-container', { timeout: 10000 });
const text = await page.$eval('.content', (e) => e.textContent);
expect(text).not.toContain('Document could not be loaded');
Expand Down Expand Up @@ -73,12 +73,12 @@ describe('App.js', () => {
// pagination
const original_content = await page.content();
await page.click('a[type="pageItem"][value="2"]');
await page.waitForSelector('.content', { timeout: 1000 });
await page.waitForSelector('.content', { timeout: 10000 });
expect(await page.content()).not.toEqual(original_content);

// link to section
await page.click('.standard-page__links-container>.title>a');
await page.waitForSelector('.content', { timeout: 1000 });
await page.waitForSelector('.content', { timeout: 10000 });
const url = await page.url();
expect(url).toContain('section');
const section = await page.$eval('.standard-page > span:nth-child(2)', (e) => e.textContent);
Expand All @@ -103,12 +103,12 @@ describe('App.js', () => {

it('can search for a cre', async () => {
await page.goto('http://127.0.0.1:5000');
await page.waitForSelector('#SearchBar', { timeout: 1000 });
await page.waitForSelector('#SearchButton', { timeout: 1000 });
await page.waitForSelector('#SearchBar', { timeout: 10000 });
await page.waitForSelector('#SearchButton', { timeout: 10000 });
await page.type('#SearchBar > div > input', '558-807');
await page.click('#SearchButton');
await page.waitForSelector('.content', { timeout: 10000 });
await page.waitForSelector('.standard-page__links-container', { timeout: 200000 });
await page.waitForSelector('.standard-page__links-container', { timeout: 10000 });
const text = await page.$$('.content', (e) => e.textContent);
expect(text).not.toContain('Document could not be loaded');

Expand All @@ -124,7 +124,7 @@ describe('App.js', () => {
await page.click('.dropdown');
const selector =
'.standard-page__links-container>.document-node>.document-node__link-type-container:nth-child(2)';
await page.waitForSelector(selector, { timeout: 2000 });
await page.waitForSelector(selector, { timeout: 10000 });

const nested = await page.$$(
'.standard-page__links-container>.document-node>.document-node__link-type-container>div>.accordion'
Expand All @@ -134,7 +134,7 @@ describe('App.js', () => {

it('can filter', async () => {
await page.goto('http://127.0.0.1:5000/cre/558-807?applyFilters=true&filters=asvs');
await page.waitForSelector('.cre-page__links-container', { timeout: 200000 });
await page.waitForSelector('.cre-page__links-container', { timeout: 10000 });
// Get inner text
const innerText = await page.evaluate(
() => (document.querySelector('.cre-page__links-container') as HTMLElement)?.innerText
Expand All @@ -145,7 +145,7 @@ describe('App.js', () => {

// ensure case insensitive filtering
await page.goto('http://127.0.0.1:5000/cre/558-807?applyFilters=true&filters=ASVS');
await page.waitForSelector('.cre-page__links-container', { timeout: 200000 });
await page.waitForSelector('.cre-page__links-container', { timeout: 10000 });
const intxt = await page.evaluate(
() => (document.querySelector('.cre-page__links-container') as HTMLElement)?.innerText
);
Expand Down

0 comments on commit d81c2aa

Please sign in to comment.