Skip to content

Commit

Permalink
Merge pull request #113 from rtjord/112-fix-test
Browse files Browse the repository at this point in the history
more tests stuff
  • Loading branch information
rtjord authored Dec 9, 2024
2 parents f85a1ae + 070cf51 commit 10e3290
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions frontend/tests/selenium/website.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,17 @@ describe('Team Five Packages Website', function () {
expect(currentUrl).to.include('/packages');
});

it('should search for a package and display results', async function () {
it('should navigate to the Upload page', async function () {
await driver.get('https://www.teamfivepackages.com');
// Wait for the search box to be visible
const searchBox = await driver.wait(until.elementLocated(By.name('Enter package name, ID, or search pattern...')), 10000);
await searchBox.sendKeys('debug');

// Wait for the search button and click it
const searchButton = await driver.wait(until.elementLocated(By.linkText('Search by Name')), 10000);
await searchButton.click();
// Wait for the "Packages" link to be visible
const packagesLink = await driver.wait(until.elementLocated(By.linkText('Upload Package')), 10000);
await packagesLink.click();

// Wait for the search results to be displayed
await driver.wait(until.elementsLocated(By.css('.package-result')), 10000);
// Wait for the URL to change
await driver.wait(until.urlContains('/upload'), 10000);

const results = await driver.findElements(By.css('.package-result'));
expect(results.length).to.be.greaterThan(0); // Ensure results are displayed
const currentUrl = await driver.getCurrentUrl();
expect(currentUrl).to.include('/upload');
});

// Quit WebDriver after tests
Expand Down

0 comments on commit 10e3290

Please sign in to comment.