Skip to content
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

chore: add admin campaign applications #1882

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
2 changes: 2 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ PAYPAL_CLIENT_ID=sb
###########
GHOST_API_URL=https://blog.podkrepi.bg
GHOST_CONTENT_KEY=86ec17c4b9660acd66b6034682
[email protected]
PODKREPI_PASSWORD=$ecurePa33
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ Watch releases of this repository to be notified about future updates:
## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-83-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

Please check [contributors guide](https://github.com/podkrepi-bg/frontend/blob/master/CONTRIBUTING.md) for:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { test, expect } from '../../../utils/fixtures'

test.describe('Create campaign application', () => {
test('should see list of applications', async ({ page, baseURL }) => {
await page.goto(`${baseURL}/admin/campaign-applications`)

await expect(page.getByRole('heading')).toHaveText('Кандидат Кампании')
// await expect(page.getByRole('row')).toHaveCount(1); // just title b/c no campaign applications yet
})
})
30 changes: 30 additions & 0 deletions e2e/utils/fixtures.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { test as base } from '@playwright/test'
import dotenv from 'dotenv'

dotenv.config({ path: '../.env.local' })
dotenv.config({ path: '../.env' })

const email = process.env.PODKREPI_EMAIL!
const password = process.env.PODKREPI_PASSWORD!

export const test = base.extend({
storageState: async ({ browser, baseURL }, use) => {
const page = await browser.newPage()
await page.goto(`${baseURL}/login`)

await page.locator('[name=email]').fill(email)
await page.locator('[name=password]').fill(password)

await page.locator('[type=submit]').click()
await page.waitForURL((url) => !url.pathname.includes('login'))

const state = await page.context().storageState()

await page.close()

use(state)
},
})

/** export the expect for consistency i.e. to be able to do `import { test, expect } from '../utils/fixtures'` */
export { expect } from 'playwright/test'
Loading