Skip to content

9 develop be able to connect to local and deployed instance #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
BASE_URL: ${{ secrets.BASE_URL }}
KEYCLOAK_USER: ${{ secrets.KEYCLOAK_USER }}
KEYCLOAK_PWD: ${{ secrets.KEYCLOAK_PWD }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ node_modules/
/playwright-report/
/blob-report/
/playwright/.cache/
/tests-example/
/tests-example/

# For Local Development
/.auth/
playwright.env
11 changes: 6 additions & 5 deletions pages/LandingPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ export class LandingPage {
this.page = page;
}

async goto() {
await this.page.goto('/');
}

async clickLoginButton() {
return this.page.getByRole('button', { name: 'Login' }).click();
}


async login(username: string, password: string) {
await this.clickLoginButton();
await this.page.getByRole('textbox', { name: 'Username' }).fill(username);
await this.page.getByRole('textbox', { name: 'Password' }).fill(password);
await this.page.getByRole('button', { name: 'Sign in' }).click();
}
}
17 changes: 16 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,24 @@ export default defineConfig({

/* Configure projects for major browsers */
projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/ },

{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
use: {
...devices['Desktop Chrome'],
storageState: './.auth/user.json',
},
dependencies: ['setup'],
},

{
name: 'local',
testMatch: /.*\.ide\.spec\.ts/,
use: {
headless: false,
baseURL: process.env.LOCAL_URL || 'http://localhost:3000',
},
},

],
Expand Down
1 change: 0 additions & 1 deletion playwright.env

This file was deleted.

5 changes: 5 additions & 0 deletions playwright.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BASE_URL=https://theia.artemis.cit.tum.de # The URL of the Theia Landing Page
LOCAL_URL=http://localhost:3000 # Locally deployed Theia (Change the URL/Port if needed)
INSTANCE_URL=https://instance.theia.artemis.cit.tum.de # The URL of the Theia Onlinde IDE (Local or Deployed)
KEYCLOAK_USER= # Username for Keycloak
KEYCLOAK_PWD= # Password for Keycloak
Loading