Skip to content

Commit

Permalink
e2e test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
john681611 committed Sep 18, 2023
1 parent 987850f commit 9ec4077
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const SearchBar = () => {
});
}}
label={
<Button primary onSubmit={onSubmit}>
<Button id="SearchButton" primary onSubmit={onSubmit}>
<Icon name="search" />
Search
</Button>
Expand Down
14 changes: 5 additions & 9 deletions application/frontend/src/test/basic-e2etest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ describe('App.js', () => {
await page.goto('http://localhost:5000');
await page.waitForSelector('#SearchBar');
const text = await page.$eval('#SearchBar', (e) => e.textContent);
expect(text).toContain('Topic text');
expect(text).toContain('Search');
});

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.type('#SearchBar > div > input', 'asdf');
await page.click('#SearchButton > button');
await page.click('#SearchButton');
await page.waitForSelector('.content', { timeout: 1000 });
const text = await page.$eval('.content', (e) => e.textContent);
expect(text).toContain('Document could not be loaded');
Expand All @@ -39,7 +39,7 @@ describe('App.js', () => {
await page.waitForSelector('#SearchBar', { timeout: 1000 });
await page.waitForSelector('#SearchButton', { timeout: 1000 });
await page.type('#SearchBar > div > input', 'crypto');
await page.click('#SearchButton > button');
await page.click('#SearchButton');
await page.waitForSelector('.content', { timeout: 1000 });
await page.waitForSelector('.standard-page__links-container', { timeout: 1000 });
const text = await page.$eval('.content', (e) => e.textContent);
Expand All @@ -60,9 +60,7 @@ describe('App.js', () => {
await page.waitForSelector('#SearchBar', { timeout: 1000 });
await page.waitForSelector('#SearchButton', { timeout: 1000 });
await page.type('#SearchBar > div > input', 'asvs');
await page.click('#SearchBar > .ui > .dropdown');
await page.click('div[path="/node/standard"]');
await page.click('#SearchButton > button');
await page.click('#SearchButton');
await page.waitForSelector('.content', { timeout: 1000 });
await page.waitForSelector('.standard-page__links-container', { timeout: 1000 });
const text = await page.$$('.content', (e) => e.textContent);
Expand Down Expand Up @@ -112,9 +110,7 @@ describe('App.js', () => {
await page.waitForSelector('#SearchBar', { timeout: 1000 });
await page.waitForSelector('#SearchButton', { timeout: 1000 });
await page.type('#SearchBar > div > input', '558-807');
await page.click('#SearchBar > .ui > .dropdown');
await page.click('div[path="/cre"]');
await page.click('#SearchButton > button');
await page.click('#SearchButton');
await page.waitForSelector('.content', { timeout: 1000 });
await page.waitForSelector('.cre-page__links-container', { timeout: 2000 });
const text = await page.$$('.content', (e) => e.textContent);
Expand Down

0 comments on commit 9ec4077

Please sign in to comment.