Skip to content

Commit

Permalink
[test] Try improve test e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
yunusefendi52 committed Dec 4, 2024
1 parent d226e35 commit ca01401
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# user=password:user=password;
NUXT_LOCAL_AUTHS=usertest1=a5756f781e0e433986364b82de545c3b:usertest2=963a71f1868248df912e7488e02233f0
NUXT_PUBLIC_LOCAL_AUTH_ENABLED=true
NUXT_APP_ENABLE_DRIZZLE_LOGGING=true
NUXT_APP_ENABLE_DRIZZLE_LOGGING=false
NUXT_DB_URL=http://localhost:8888
NUXT_DB_AUTH_TOKEN=basic:c3FsZDppOHJ3ZXlzNzBkN2Zh
NUXT_S3_ENDPOINT=http://localhost:9000
Expand All @@ -12,3 +12,4 @@ NUXT_PUBLIC_GOOGLE_CLIENT_ID=sample-fc72420db46b4bfaaba8ea97a74535a7.apps.google
NUXT_APP_MIGRATION_ENABLE=true
NUXT_APP_MIGRATION_DIR=
NUXT_APP_API_AUTH_KEY=dy9ea7v24f9f46j94p4xp1gcozwn1qcmgweb7kdzhuxi9br7gi89t2uy2r1896ag
WORKAROUND_FIX_BREAK_PLAYWRIGHT=1
2 changes: 0 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ jobs:
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: bunx playwright install --with-deps
- name: Setup e2e env
run: echo "${{ secrets.ENV_TESTS_BASE64 }}" | base64 --decode >> .env
- run: bun run e2e

- name: Deploy
Expand Down
4 changes: 4 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export default defineNuxtConfig({
define: {
global: {},
},

optimizeDeps: {
exclude: process.env.WORKAROUND_FIX_BREAK_PLAYWRIGHT === '1' ? ['primevue'] : [],
},
},

app: {
Expand Down
2 changes: 1 addition & 1 deletion pages/apps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const upperCase = (value: string | null | undefined) => {
orgName: orgNameParam?.toString() ?? '',
},
}" v-if="isOrg">
<Button icon="pi pi-cog" outlined aria-label="Settings" />
<Button icon="pi pi-cog" outlined aria-label="Settings" data-testid="settings_btn" />
</NuxtLink>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion setup-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

dotenv() {
set -a
[ -f .env ] && . .env.test
[ -f .env.test ] && . .env.test
set +a
}

Expand Down
4 changes: 2 additions & 2 deletions tests-e2e/apps.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ test('Apps test', async ({ page, goto, context }) => {

await test.step('User admin can delete org', async () => {
await page.getByTestId('a_menus').getByText(orgName).click()
await page.getByLabel('Settings').click()
await page.getByLabel('Danger').click()
await page.getByTestId('settings_btn').click()
await page.getByRole('menuitem').nth(2).click()
const orgId = await page.getByTestId('org_name_span').textContent()
await page.getByTestId('orgName').fill(orgId!)
await page.getByTestId('deleteOrgBtn').click()
Expand Down

0 comments on commit ca01401

Please sign in to comment.