Skip to content
This repository was archived by the owner on Jan 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/frontend/mobile/test/navigation_page_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:aether/views/applet/pages/applet_creation.dart';
import 'package:aether/views/mainPage/pages/main_navigation.dart';

void main() {
group('MainNavigationPage Tests', () {
testWidgets('Floating action button opens AppletCreation page',
(WidgetTester tester) async {
await tester.pumpWidget(const MaterialApp(home: MainNavigationPage()));

await tester.tap(find.byType(FloatingActionButton));
await tester.pumpAndSettle();

expect(find.byType(AppletCreation), findsOneWidget);
});
});
}
17 changes: 17 additions & 0 deletions apps/frontend/mobile/test/setting_page_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:aether/views/settings/pages/settings_page.dart';

void main() {
testWidgets('SettingsPage has Go to Profile and Change API buttons',
(WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: SettingsPage(),
),
);

expect(find.text('Go to Profile'), findsOneWidget);
expect(find.text('Change API'), findsOneWidget);
});
}
47 changes: 31 additions & 16 deletions apps/frontend/web/e2e/demo.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
import { test } from '@playwright/test';

test('Applets explorer', async ({ page }) => {
await page.goto('http://localhost:5173/');
await page.locator('.grid > div').first().click();
});

test('Providers explorer', async ({ page }) => {
await page.goto('http://localhost:5173/providers');
await page.locator('.grid > div').first().click();
});

test('Applets to providers explorer', async ({ page }) => {
await page.goto('http://localhost:5173/');
await page.getByRole('link', { name: 'Providers' }).click();
});
import { test, expect } from '@playwright/test';

const baseURL = 'http://localhost:8081';

test.describe('App walkthrough', () => {
test('should walk through the app', async ({ page }) => {
await page.goto(`${baseURL}/auth/login`);

await page.locator('input[placeholder="Enter your email"]').fill('test@test.com');
await page.locator('input[placeholder="Enter your password"]').fill('123456789aA$$');
await page.locator('button:text("Sign in")').click();


const currentURL = page.url();
console.log(`Current URL after login: ${currentURL}`);

const pageTitle = await page.title();
console.log(`Page title after login: ${pageTitle}`);

const bodyText = await page.locator('body').innerText();
console.log(`Body text after login: ${bodyText}`);

const loggedInElements = await page.locator('text=Logout, text=Profile, text=Settings').allTextContents();
console.log(`Visible elements indicating login status: ${loggedInElements}`);

await page.goto(`${baseURL}/explore/applets`);
const appletsURL = page.url();
console.log(`Current URL after navigating to applets: ${appletsURL}`);
await expect(page.locator('text=Applets')).toBeVisible();
});
});