Skip to content

Commit

Permalink
D03 sin about
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoRedondoo committed Jul 4, 2024
1 parent eea27db commit 96a4a39
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
async function fetchTop10UFCEvents() {
try {
let API = 'http://localhost:10002/api/v1';
let API = 'https://sos2324-jul-nrm-428011.ew.r.appspot.com/api/v1';
if (dev) API = 'http://localhost:10002/api/v1';
const response = await fetch(`${API}/ufc-events-data`);
if (response.ok) {
const data = await response.json();
Expand Down
18 changes: 11 additions & 7 deletions tests/e2e/home.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
const { test, expect } = require('@playwright/test');

test('has title', async ({ page }) => {
await page.goto('http://localhost:10002');
await page.goto('https://sos2324-jul-nrm-428011.ew.r.appspot.com');

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/APIs nicredmor/);
});

test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
test('loads data list on button click', async ({ page }) => {
await page.goto('https://sos2324-jul-nrm-428011.ew.r.appspot.com/ufc-events-data');

// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();
// Click the "Insertar datos" button
await page.locator('text=Insertar datos').click();

// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
// Wait for the list container to be visible
await page.waitForSelector('.event-box'); // Replace with actual CSS selector for event container

// Verify the list contains elements
const items = await page.$$('.event-box'); // Replace with actual CSS selector for event items
expect(items.length).toBeGreaterThan(0);
});

0 comments on commit 96a4a39

Please sign in to comment.