-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from Kibibit/feature/websockets-and-dev-center
Feature/websockets and dev center
- Loading branch information
Showing
41 changed files
with
517 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Observable } from 'rxjs'; | ||
import { io, Socket } from 'socket.io-client'; | ||
import { Injectable } from '@angular/core'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class SocketService { | ||
private socket: Socket; | ||
|
||
constructor() { | ||
this.socket = io(window.location.origin); | ||
} | ||
|
||
emit(event: string, data: any) { | ||
this.socket.emit(event, data); | ||
} | ||
|
||
on(event: string): Observable<any> { | ||
return new Observable((observer) => { | ||
this.socket.on(event, (data) => { | ||
observer.next(data); | ||
}); | ||
|
||
// Handle cleanup | ||
return () => { | ||
this.socket.off(event); | ||
}; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
test('has title', async ({ page }) => { | ||
await page.goto('https://playwright.dev/'); | ||
test('achievibit test', async ({ page }) => { | ||
await page.goto('http://localhost:10101'); | ||
|
||
// Expect a title "to contain" a substring. | ||
await expect(page).toHaveTitle(/Playwright/); | ||
await expect(page).toHaveTitle(/achievibit/); | ||
|
||
await expect(page.getByRole('heading', { name: 'achievibit' })).toBeVisible(); | ||
}); | ||
|
||
test('login with github', async ({ page }) => { | ||
await page.goto('http://localhost:10101'); | ||
|
||
// Click the login with github button. | ||
await page.getByRole('link', { name: 'Login with GitHub' }).click(); | ||
|
||
// expect to be redirected to github login page | ||
await expect(page).toHaveURL(/github/); | ||
await expect(page.getByText('Sign in to GitHub to continue')).toBeVisible(); | ||
}); | ||
|
||
test('login with gitlab', async ({ page }) => { | ||
await page.goto('http://localhost:10101'); | ||
|
||
// Click the login with gitlab button. | ||
await page.getByRole('link', { name: 'Login with GitLab' }).click(); | ||
|
||
// expect to be redirected to gitlab login page | ||
await expect(page).toHaveURL(/gitlab/); | ||
await expect(page.getByRole('heading', { name: 'Verify you are human by' })).toBeVisible(); | ||
}); | ||
|
||
test('get started link', async ({ page }) => { | ||
await page.goto('https://playwright.dev/'); | ||
test('login with bitbucket', async ({ page }) => { | ||
await page.goto('http://localhost:10101'); | ||
|
||
// Click the get started link. | ||
await page.getByRole('link', { name: 'Get started' }).click(); | ||
// Click the login with bitbucket button. | ||
await page.getByRole('link', { name: 'Login with Bitbucket' }).click(); | ||
|
||
// Expects page to have a heading with the name of Installation. | ||
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); | ||
// expect to be redirected to bitbucket login page | ||
await expect(page).toHaveURL(/bitbucket/); | ||
await expect(page.getByTestId('username')).toBeVisible(); | ||
}); |
Oops, something went wrong.