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

Publish Stage #4013

Merged
merged 7 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
61 changes: 55 additions & 6 deletions .github/workflows/frontend-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
environment_url: ${{ steps.vercel.outputs.environment_url }}
run: echo "$environment_url"

preview-swap-tests:
timeout-minutes: 10
preview-swap-osmo-tests:
timeout-minutes: 15
runs-on: macos-latest
needs: wait-for-deployment
steps:
Expand Down Expand Up @@ -65,13 +65,61 @@ jobs:
WALLET_ID: ${{ secrets.TEST_WALLET_ID }}
run: |
cd packages/e2e
npx playwright test -g "Test Swap feature"
npx playwright test swap.osmo.wallet
- name: upload Swap test results
if: failure()
id: swap-test-results
uses: actions/upload-artifact@v4
with:
name: preview-swap-test-results
name: osmo-swap-test-results
path: packages/e2e/playwright-report

preview-swap-usdc-tests:
timeout-minutes: 15
runs-on: macos-latest
needs: [wait-for-deployment, preview-swap-osmo-tests]
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
sparse-checkout: |
packages/e2e
- name: print environment_url and BRANCH_NAME
env:
BASE_URL: "https://${{ needs.wait-for-deployment.outputs.environment_url }}"
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
echo "$BASE_URL"
echo "$BRANCH_NAME"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Cache dependencies
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.OS }}-20.x-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-20.x-
- name: Install Playwright
run: |
echo "$GITHUB_OUTPUT"
yarn --cwd packages/e2e install --frozen-lockfile && npx playwright install --with-deps chromium
- name: Run Swap Pair tests
env:
BASE_URL: "https://${{ needs.wait-for-deployment.outputs.environment_url }}"
PRIVATE_KEY: ${{ secrets.TEST_PRIVATE_KEY }}
WALLET_ID: ${{ secrets.TEST_WALLET_ID }}
run: |
cd packages/e2e
npx playwright test swap.usdc.wallet
- name: upload Swap test results
if: failure()
id: swap-test-results
uses: actions/upload-artifact@v4
with:
name: usdc-swap-test-results
path: packages/e2e/playwright-report

preview-portfolio-trx-tests:
Expand Down Expand Up @@ -153,9 +201,10 @@ jobs:
path: packages/e2e/playwright-report

preview-trade-tests:
timeout-minutes: 10
timeout-minutes: 15
runs-on: macos-latest
needs: [wait-for-deployment, preview-swap-tests]
needs:
[wait-for-deployment, preview-swap-osmo-tests, preview-swap-usdc-tests]
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/monitoring-quote-geo-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
run: curl -L "https://ipinfo.io" -s
- name: Check out repository
uses: actions/checkout@v4
with:
sparse-checkout: |
packages/e2e
- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/prod-frontend-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ jobs:

prod-e2e-tests:
runs-on: macos-latest
timeout-minutes: 15
timeout-minutes: 20
needs: wait-for-deployment
environment:
name: prod_swap_test
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
sparse-checkout: |
packages/e2e
ref: master
- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -60,7 +62,7 @@ jobs:
WALLET_ID: ${{ secrets.TEST_WALLET_ID }}
run: |
cd packages/e2e
npx playwright test transactions portfolio swap.wallet
npx playwright test transactions portfolio swap.osmo.wallet
- name: upload test results
if: always()
id: e2e-test-results
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ All you need to add is a private keys for wallets that are being used:
To install Playwright, please execute `npx playwright install --with-deps chromium` from the /web folder.

To run a Select pair tests, please execute `npx playwright test -g "Test Select Swap Pair feature"` from the /web folder.
To run a Swap E2E tests, please execute `npx playwright test -g "Test Swap feature"` from the /web folder.
To run a Swap E2E tests, please execute `npx playwright test swap.osmo.wallet` from the /web folder.
To run a Monitoring E2E tests, please execute `npx playwright test monitoring --timeout 180000` from the /web folder.

Tests can be executed locally in a browser by changing `headless: true` to `headless: false`.
Expand Down
185 changes: 92 additions & 93 deletions packages/e2e/tests/select.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,105 +4,104 @@ import {
type Page,
chromium,
test,
} from '@playwright/test'
} from "@playwright/test";

import { TradePage } from '../pages/trade-page'
import { TestConfig } from '../test-config'
import { TradePage } from "../pages/trade-page";
import { TestConfig } from "../test-config";

// Pairs are selected from top 10
test.describe('Test Select Swap Pair feature', () => {
let context: BrowserContext
let swapPage: TradePage
let page: Page
test.describe("Test Select Swap Pair feature", () => {
let context: BrowserContext;
let swapPage: TradePage;
let page: Page;

test.beforeAll(async () => {
context = await chromium.launchPersistentContext(
'',
new TestConfig().getBrowserConfig(true),
)
page = context.pages()[0]
swapPage = new TradePage(page)
await swapPage.goto()
})
"",
new TestConfig().getBrowserConfig(true)
);
page = context.pages()[0];
swapPage = new TradePage(page);
await swapPage.goto();
});

test.afterAll(async () => {
await context.close()
})

// Price Impact-54.768% -> no liquidity
test('User should be able to select nBTC/USDC', async () => {
await swapPage.goto()
await swapPage.selectPair('nBTC', 'USDC')
await swapPage.enterAmount('0.01')
await swapPage.showSwapInfo()
})

test('User should be able to select WBTC/USDC', async () => {
await swapPage.goto()
await swapPage.selectPair('WBTC', 'USDC')
await swapPage.enterAmount('0.1')
await swapPage.showSwapInfo()
})

test('User should be able to select OSMO/USDC', async () => {
await swapPage.goto()
await swapPage.selectPair('OSMO', 'USDC')
await swapPage.enterAmount('1')
await swapPage.showSwapInfo()
})

test('User should be able to select INJ/USDC', async () => {
await swapPage.goto()
await swapPage.selectPair('INJ', 'USDC')
await swapPage.enterAmount('10')
await swapPage.showSwapInfo()
})

test('User should be able to select TIA/USDC', async () => {
await swapPage.goto()
await swapPage.selectPair('TIA', 'USDC')
await swapPage.enterAmount('100')
await swapPage.showSwapInfo()
})

test('User should be able to select ATOM/USDC', async () => {
await swapPage.selectPair('ATOM', 'USDC')
await swapPage.enterAmount('100')
})

test('User should be able to select USDT/USDC', async () => {
await swapPage.selectPair('USDT', 'USDC')
await swapPage.enterAmount('10000')
})

test('User should be able to select TIA/OSMO', async () => {
await swapPage.selectPair('TIA', 'OSMO')
await swapPage.enterAmount('100')
})

test('User should be able to select AKT/OSMO', async () => {
await swapPage.selectPair('AKT', 'OSMO')
await swapPage.enterAmount('100')
})

test('User should be able to select PICA/OSMO', async () => {
await swapPage.selectPair('PICA', 'OSMO')
await swapPage.enterAmount('100')
})

test('User should be able to select USDT/OSMO', async () => {
await swapPage.selectPair('USDT', 'OSMO')
await swapPage.enterAmount('100')
})

test('User should be able to select TIA/BOOT', async () => {
await context.close();
});

test("User should be able to select BTC/USDC", async () => {
await swapPage.goto();
await swapPage.selectPair("nBTC", "USDC");
await swapPage.enterAmount("0.01");
await swapPage.showSwapInfo();
});

test("User should be able to select WBTC/USDC", async () => {
await swapPage.goto();
await swapPage.selectPair("WBTC", "USDC");
await swapPage.enterAmount("0.1");
await swapPage.showSwapInfo();
});

test("User should be able to select OSMO/USDC", async () => {
await swapPage.goto();
await swapPage.selectPair("OSMO", "USDC");
await swapPage.enterAmount("1");
await swapPage.showSwapInfo();
});

test("User should be able to select INJ/USDC", async () => {
await swapPage.goto();
await swapPage.selectPair("INJ", "USDC");
await swapPage.enterAmount("10");
await swapPage.showSwapInfo();
});

test("User should be able to select TIA/USDC", async () => {
await swapPage.goto();
await swapPage.selectPair("TIA", "USDC");
await swapPage.enterAmount("100");
await swapPage.showSwapInfo();
});

test("User should be able to select ATOM/USDC", async () => {
await swapPage.selectPair("ATOM", "USDC");
await swapPage.enterAmount("100");
});

test("User should be able to select USDT/USDC", async () => {
await swapPage.selectPair("USDT", "USDC");
await swapPage.enterAmount("10000");
});

test("User should be able to select TIA/OSMO", async () => {
await swapPage.selectPair("TIA", "OSMO");
await swapPage.enterAmount("100");
});

test("User should be able to select AKT/OSMO", async () => {
await swapPage.selectPair("AKT", "OSMO");
await swapPage.enterAmount("100");
});

test("User should be able to select PICA/OSMO", async () => {
await swapPage.selectPair("PICA", "OSMO");
await swapPage.enterAmount("100");
});

test("User should be able to select USDT/OSMO", async () => {
await swapPage.selectPair("USDT", "OSMO");
await swapPage.enterAmount("100");
});

test("User should be able to select TIA/BOOT", async () => {
// Just to verify some odd pair
await swapPage.selectPair('TIA', 'BOOT')
await swapPage.enterAmount('100')
})

test('User should be able to select stATOM/USDC', async () => {
await swapPage.selectPair('stATOM', 'USDC')
await swapPage.enterAmount('100')
})
})
await swapPage.selectPair("TIA", "BOOT");
await swapPage.enterAmount("100");
});

test("User should be able to select stATOM/USDC", async () => {
await swapPage.selectPair("stATOM", "USDC");
await swapPage.enterAmount("100");
});
});
Loading
Loading