Skip to content

Commit

Permalink
more improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
john681611 committed Nov 9, 2023
1 parent 99e08c3 commit 4efbca5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y python3-setuptools python3-pip chromium-browser libgbm1 && make install-deps
- name: DB setup
run: |
cp cres/db.sqlite standards_cache.sqlite
make migrate-upgrade
- name: Run App in background
run: |
Expand Down
10 changes: 6 additions & 4 deletions application/frontend/src/test/basic-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ describe('App.js', () => {
await page.type('#SearchBar > div > input', 'crypto');
await page.click('#SearchBar > div > button');
await page.waitForSelector('.content');
await page.waitForSelector('.standard-page__links-container');
const text = await page.$eval('.content', (e) => e.textContent);
expect(text).not.toContain('No results match your search term');


await page.waitForSelector('.standard-page__links-container');
const results = await page.$$('.standard-page__links-container');
expect(results.length).toBeGreaterThan(1);

Expand All @@ -57,10 +57,11 @@ describe('App.js', () => {
it('can search for a standard by name, section and the standard page works as expected', async () => {
await page.goto('http://127.0.0.1:5000/node/standard/ASVS');
await page.waitForSelector('.content');
await page.waitForSelector('.standard-page__links-container');
const text = await page.$$('.content', (e) => e.textContent);
expect(text).not.toContain('No results match your search term');

await page.waitForSelector('.standard-page__links-container');

// title match
const page_title = await page.$eval('.standard-page__heading', (e) => e.textContent);
expect(page_title).toContain('ASVS');
Expand Down Expand Up @@ -106,9 +107,10 @@ describe('App.js', () => {
await page.type('#SearchBar > div > input', '558-807');
await page.click('#SearchBar > div > button');
await page.waitForSelector('.content');
await page.waitForSelector('.standard-page__links-container');
const text = await page.$$('.content', (e) => e.textContent);
expect(text).not.toContain('No results match your search term');

await page.waitForSelector('.standard-page__links-container');

// title match
const entry_title = await page.$eval('div.title.document-node', (e) => e.textContent);
Expand Down

0 comments on commit 4efbca5

Please sign in to comment.