-
-
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.
Added more tests and updated the Spring stubs (#1)
* Added more tests and updated the Spring stubs
- Loading branch information
1 parent
eeed51a
commit d857326
Showing
15 changed files
with
111 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,59 @@ | ||
import os from 'os' | ||
import { test, expect } from '@playwright/test' | ||
import * as timers from 'timers' | ||
|
||
// See here how to get started: | ||
// https://playwright.dev/docs/intro | ||
test('visits the app root url and show dependency dialog', async ({ page }) => { | ||
const metaKey = os.platform() === 'darwin' ? 'Meta' : 'Control' | ||
// expect(getUA).toBe('taco') | ||
// console.log(isMac) | ||
await page.goto('/') | ||
await expect(page.locator('body')).toHaveCount(1) | ||
|
||
// Initially there should not be any selected package item | ||
await expect(page.locator('div[data-selected-package-item="true"]')).toHaveCount(0) | ||
|
||
// Make sure dependencies button is shown and clickable | ||
await expect(page.getByRole('button', { name: 'Add Dependencies' })).toHaveCount(1) | ||
await page.getByRole('button', { name: 'Add Dependencies' }).click({ force: true }) | ||
|
||
// Make sure that items are displayed | ||
await expect(page.locator('div[role="dialog"]')).toHaveCount(1) | ||
await expect(page.locator('div[data-package-item="true"]')).toHaveCount(65) | ||
await expect(page.locator('div[data-package-item-id="lombok"]')).toHaveCount(1) | ||
|
||
// Make sure package filter works | ||
await page.locator('input[name="dependencies-input-filter"]').fill('web') | ||
await expect(page.locator('div[data-package-item="true"]')).toHaveCount(4) | ||
await expect(page.locator('div[data-package-item-id="lombok"]')).toHaveCount(0) | ||
await page.locator('div[data-package-item-id="web"]').click() | ||
|
||
// Make sure that package selection works | ||
await expect(page.locator('div[data-selected-package-item="true"]')).toHaveCount(1) | ||
await expect(page.locator('div[data-selected-package-item-id="web"]')).toHaveCount(1) | ||
|
||
// Make sure that remove package button works | ||
await expect(page.locator('button[title="Remove this package"]')).toHaveCount(1) | ||
page.locator('button[title="Remove this package"]').click() | ||
await expect(page.locator('div[data-selected-package-item="true"]')).toHaveCount(0) | ||
|
||
// Make sure that multiple works | ||
await expect(page.getByRole('button', { name: 'Add Dependencies' })).toHaveCount(1) | ||
await page.getByRole('button', { name: 'Add Dependencies' }).click({ force: true }) | ||
|
||
timers.setTimeout(async () => { | ||
await expect(page.locator('div[data-package-item-id="web"]')).toHaveCount(1) | ||
await page.locator('div[data-package-item-id="web"]').click({ modifiers: [metaKey] }) | ||
//await page.keyboard.press(`${metaKey}+Enter`) | ||
|
||
await page.locator('div[data-package-item-id="lombok"]').click({ modifiers: [metaKey] }) | ||
//await page.keyboard.press(`${metaKey}+Enter`) | ||
|
||
await page.locator('input[name="dependencies-input-filter"]').press('Escape') | ||
|
||
// Make sure Dependencies dialog is closed and appropriate packages are shown | ||
//await expect(page.locator('div[role="dialog"]')).toHaveCount(0) | ||
await expect(page.locator('div[data-selected-package-item="true"]')).toHaveCount(2) | ||
}, 2000) | ||
}) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export enum SpringBootVersion { | ||
'3_0_11' = '3.0.11', | ||
'3_1_4' = '3.1.4' | ||
'3_0_12' = '3.0.12', | ||
'3_1_5' = '3.1.5' | ||
} |
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
4 changes: 2 additions & 2 deletions
4
src/generator/spring/__tests__/outputs/all-developer-tools-selected-with-kotlin.output
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
2 changes: 1 addition & 1 deletion
2
src/generator/spring/__tests__/outputs/nothing-selected-with-kotlin.output
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