-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: debug playwright chore: debug playwright chore: debug playwright chore: debug playwright chore: debug playwright chore: debug playwright chore: debug playwright chore: debug playwright chore: debug playwright chore: debug playwright chore: debug playwright
- Loading branch information
1 parent
b05d204
commit 5a37a78
Showing
3 changed files
with
53 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,55 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { loginWithRequest } from '../../utils'; | ||
|
||
test('test', async ({ page }) => { | ||
await loginWithRequest('/wp-admin/index.php', page); | ||
|
||
if (page.url().includes('wp-login.php')) { | ||
//throw new Error('Not logged in'); | ||
await page.getByLabel('Username or Email Address').fill('admin'); | ||
await page.getByLabel('Password').fill('admin'); | ||
await page.getByRole('button', { name: 'Log In' }).click(); | ||
} | ||
|
||
await expect(page).toHaveURL(/wp-admin\/index.php/); | ||
|
||
await expect(page.locator('button.install-now')).toContainText( | ||
'Try one of our ready to use Starter Sites' | ||
); | ||
await expect(page.locator('button.install-now')).toBeVisible(); | ||
await page.locator('button.install-now').click(); | ||
|
||
await expect(page.locator('button.install-now')).toContainText( | ||
/(Activating|Installing)/ | ||
); | ||
|
||
await page.waitForNavigation(); | ||
|
||
await expect(page).toHaveURL( | ||
/wp-admin\/themes.php\?page=tiob-starter-sites&onboarding=yes/ | ||
); | ||
|
||
await expect(page.locator('a.tab')).toContainText([ | ||
'All Categories', | ||
'Free', | ||
'Business', | ||
'Portfolio', | ||
'WooCommerce', | ||
'Blog', | ||
'Personal', | ||
'Other', | ||
]); | ||
|
||
await page.goto('/wp-admin/index.php'); | ||
|
||
await expect(page).toHaveURL(/wp-admin\/index.php/); | ||
|
||
await expect(page.locator('button.install-now')).not.toBeVisible(); | ||
test.describe('Dashboard Notice', () => { | ||
test('Starter Sites Plugin install from Dashboard Notice', async ({ | ||
page, | ||
}) => { | ||
await loginWithRequest('/wp-admin/index.php', page); | ||
|
||
if (page.url().includes('wp-login.php')) { | ||
//throw new Error('Not logged in'); | ||
await page.getByLabel('Username or Email Address').fill('admin'); | ||
await page.getByLabel('Password').fill('admin'); | ||
await page.getByRole('button', { name: 'Log In' }).click(); | ||
} | ||
|
||
await expect(page).toHaveURL(/wp-admin\/index.php/); | ||
|
||
await expect(page.locator('button.install-now')).toContainText( | ||
'Try one of our ready to use Starter Sites' | ||
); | ||
await expect(page.locator('button.install-now')).toBeVisible(); | ||
|
||
await Promise.all([ | ||
page.waitForNavigation({ | ||
url: /wp-admin\/themes.php\?page=tiob-starter-sites&onboarding=yes/, | ||
}), | ||
page.locator('button.install-now').click(), | ||
expect(page.locator('button.install-now')).toContainText( | ||
/(Activating|Installing)/ | ||
), | ||
]); | ||
|
||
await expect(page).toHaveURL( | ||
/wp-admin\/themes.php\?page=tiob-starter-sites&onboarding=yes/ | ||
); | ||
|
||
await expect(page.locator('a.tab')).toContainText([ | ||
'All Categories', | ||
'Free', | ||
'Business', | ||
'Portfolio', | ||
'WooCommerce', | ||
'Blog', | ||
'Personal', | ||
'Other', | ||
]); | ||
|
||
await page.goto('/wp-admin/index.php'); | ||
|
||
await expect(page).toHaveURL(/wp-admin\/index.php/); | ||
|
||
await expect(page.locator('button.install-now')).not.toBeVisible(); | ||
}); | ||
}); |