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

test: finally fix e2e env #583

Merged
merged 7 commits into from
Jul 21, 2023
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
5 changes: 5 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'

- name: Populate .env file
uses: SpicyPizza/[email protected]
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'

- name: Install deps
run: npm ci
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2

- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'

- name: Populate .env file
uses: SpicyPizza/[email protected]
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm install
run: npm ci

- name: Svelte Kit Sync
run: npx svelte-kit sync
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/e2e-tests/docker/scripts/clone-subgraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ git clone -b feature/dependency-funding --single-branch https://github.com/radic

echo "📁 Creating subgraph config file for local env"
cd ./drips-subgraph
printf '{ "network": "goerli", "immutableSplitsDriver": { "address": "0xaD2E5BECB55D12bc6D011c70226b82E642fFCF14", "block": 1 }, "repoDriver": { "address": "0x70F397E19fBc78f1F2090C3F4137BEd4fAD5C79e", "block": 1 }, "drips": { "address": "0x476FB1C8745AffE9B3032C58c83AEA4C05Ddf136", "block": 1 }, "nftDriver": { "address": "0xa16D9683E368a72F5a3ee5761298589dB129fcbc", "block": 1 },"metaData": { "address": "0xC58cEa5a448A761d2dE80DFa8BfE298780e9dd66", "block": 1 } }' > config.json
printf '{ "network": "goerli", "immutableSplitsDriver": { "address": "0xEC8493BdbBbBe22a6F54573cFeE23ac8Ab90dF77", "block": 1 }, "repoDriver": { "address": "0xb9C8e18E82687a564Ac4D26E22D28a4C95057CE9", "block": 1 }, "drips": { "address": "0xa0523b86472561f0859d84C094cc04e6c4B33169", "block": 1 }, "nftDriver": { "address": "0xc95eb214845d5693abc750692161CB008796ae5C", "block": 1 },"metaData": { "address": "0xC58cEa5a448A761d2dE80DFa8BfE298780e9dd66", "block": 1 } }' > config.json
echo "🛠 Installing subgraph deps…"
npm install

Expand Down
Binary file modified src/e2e-tests/docker/testnet/state/000005.ldb
Binary file not shown.
Binary file modified src/e2e-tests/docker/testnet/state/000006.log
Binary file not shown.
10 changes: 5 additions & 5 deletions src/e2e-tests/docker/testnet/state/LOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
2023/07/06-16:32:50.802183 16ff0f000 Recovering log #3
2023/07/06-16:32:50.804756 16ff0f000 Level-0 table #5: started
2023/07/06-16:32:50.807933 16ff0f000 Level-0 table #5: 542758 bytes OK
2023/07/06-16:32:50.808325 16ff0f000 Delete type=0 #3
2023/07/06-16:32:50.808442 16ff0f000 Delete type=3 #2
2023/07/21-15:21:29.218916 1709e3000 Recovering log #3
2023/07/21-15:21:29.222105 1709e3000 Level-0 table #5: started
2023/07/21-15:21:29.226051 1709e3000 Level-0 table #5: 550554 bytes OK
2023/07/21-15:21:29.226462 1709e3000 Delete type=0 #3
2023/07/21-15:21:29.226581 1709e3000 Delete type=3 #2
2 changes: 1 addition & 1 deletion src/e2e-tests/docker/testnet/state/LOG.old
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/06-16:27:36.227953 170a23000 Delete type=3 #1
2023/07/21-15:19:56.054382 16ed53000 Delete type=3 #1
Binary file modified src/e2e-tests/docker/testnet/state/MANIFEST-000004
Binary file not shown.
30 changes: 15 additions & 15 deletions src/e2e-tests/top-up-create-stream.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('top up, create stream, view profile, search', async () => {
it('opens up to streams tab', async () => {
await page.goto('http://127.0.0.1:3000/app');

await expect(page.locator('text=Streams')).toHaveCount(2);
await expect(page).toHaveURL('http://127.0.0.1:3000/app/streams');
});

it('switches to the streams tab', async () => {
Expand Down Expand Up @@ -87,23 +87,23 @@ describe('top up, create stream, view profile, search', async () => {

await page.type(
'label:has-text("Token contract address*")',
'0x6BDE06d03AACb1359D4113c77E320B32C8Bd7837',
'0xefbF81372aBC3723463746a89CEb42080563684C',
);

await page.locator('button', { hasText: 'Add custom token' }).click();
await page.locator('button', { hasText: 'Got it' }).click();
});

it('displays the custom mock erc-20 token', async () => {
const testcoin = page.locator('text=Test token');
const testcoin = page.locator('text=Testcoin');
await testcoin.click();

const topUpButton = page.locator('text=Add Test token');
const topUpButton = page.locator('text=Add Testcoin');
await topUpButton.click();
});

it('displays the amount step', async () => {
await page.fill('label:has-text("Amount")', '0.000000000000001');
await page.fill('label:has-text("Amount")', '50');
await page.locator('data-testid=confirm-amount-button').click();
});

Expand All @@ -126,13 +126,13 @@ describe('top up, create stream, view profile, search', async () => {
});

it('allows selecting the available outbound TEST balance', async () => {
await page.locator('.label:has-text("Test token")').click();
await page.locator('.label:has-text("Testcoin")').click();
});

it('allows submitting the create stream flow', async () => {
await page.fill('label:has-text("Stream name*")', 'E2E Test Stream');
await page.fill('label:has-text("Stream to*")', '0xAa90c43123ACEc193A35D33db5D71011B019779D');
await page.fill('label:has-text("Stream rate*")', '0.00000000000000001');
await page.fill('label:has-text("Stream rate*")', '1');

await page.locator('.modal button:has-text("Create stream")').click();
});
Expand All @@ -156,7 +156,7 @@ describe('top up, create stream, view profile, search', async () => {
});

it('displays the incoming balance', async () => {
await expect(page.locator('text=Test token')).toHaveCount(1);
await expect(page.locator('text=Testcoin')).toHaveCount(1);
});
});

Expand All @@ -169,7 +169,7 @@ describe('top up, create stream, view profile, search', async () => {
});

it('displays the outgoing balance', async () => {
await expect(page.locator('text=Test token')).toHaveCount(1);
await expect(page.locator('text=Testcoin')).toHaveCount(1);
});

it('switches to another user', async () => {
Expand All @@ -189,7 +189,7 @@ describe('top up, create stream, view profile, search', async () => {
});

it('displays the incoming balance', async () => {
await expect(page.locator('text=Test token')).toHaveCount(1);
await expect(page.locator('text=Testcoin')).toHaveCount(1);
});
});

Expand All @@ -213,9 +213,9 @@ describe('top up, create stream, view profile, search', async () => {
await page.locator('data-testid=search-button').click();
await page.keyboard.type('Test');

await expect(
page.locator('.account-menu-item-wrapper', { hasText: 'Test token' }),
).toHaveCount(1);
await expect(page.locator('.account-menu-item-wrapper', { hasText: 'Testcoin' })).toHaveCount(
1,
);

await page.keyboard.press('Escape');
});
Expand Down Expand Up @@ -373,7 +373,7 @@ describe('top up, create stream, view profile, search', async () => {
it('opens the collect flow', async () => {
await page.goto('http://127.0.0.1:3000/app/streams');

await page.locator('text=Test token').click();
await page.locator('text=Testcoin').click();
await page.locator('button', { hasText: 'Collect' }).click();

await expect(page.locator('h1', { hasText: 'Collect TEST' })).toHaveCount(1);
Expand All @@ -399,7 +399,7 @@ describe('top up, create stream, view profile, search', async () => {
await page.locator('button', { hasText: 'Got it' }).click();
});

it('shows an incoming balance of zero for Test token after squeezing', async () => {
it('shows an incoming balance of zero for Testcoin after squeezing', async () => {
await expect(page.locator('data-testid=incoming-balance')).toHaveText('0.00');
});
});
Expand Down
24 changes: 12 additions & 12 deletions src/lib/utils/get-drips-clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ export const networkConfigs: { [chainId: number]: NetworkConfig } = isTest()
5: {
CHAIN: 'goerli',
DEPLOYMENT_TIME: 'foobar',
COMMIT_HASH: '54ecc90aa08e141d27e6a7d6d7835d0316cb200f',
COMMIT_HASH: '232029aa1ded48751b01709311987535ee6d3a97',
WALLET: '0xFAdDb8777bf0445aBb85DA2d1889836BaCC5C9A3',
DRIPS_DEPLOYER: '0x84cD64825C40C23e1698f87BdA8db181BCedC7f5',
DRIPS_DEPLOYER_SALT: 'DripsDeployer',
DRIPS_DEPLOYER: '0x7000eE653a4E2694d70F0099DBf8fBAe649Cd1EF',
DRIPS_DEPLOYER_SALT: 'DripsDeployerTest1',
DRIPS_CYCLE_SECONDS: '604800',
DRIPS_ADMIN: '0xFAdDb8777bf0445aBb85DA2d1889836BaCC5C9A3',
ADDRESS_DRIVER_ADMIN: '0xFAdDb8777bf0445aBb85DA2d1889836BaCC5C9A3',
Expand All @@ -161,19 +161,19 @@ export const networkConfigs: { [chainId: number]: NetworkConfig } = isTest()
SUBGRAPH_URL: `http://${
env?.PUBLIC_TEST_SUBGRAPH_HOST ?? 'localhost'
}:8000/subgraphs/name/drips-subgraph-local`,
CALLER: '0xB32DdAe2A2F98Fee768A4950559A085C7fA76Ad9',
DRIPS: '0x476FB1C8745AffE9B3032C58c83AEA4C05Ddf136',
NFT_DRIVER: '0xa16D9683E368a72F5a3ee5761298589dB129fcbc',
CALLER: '0xaBf7431BFC75BAD19AA98911c4dd7165b619771F',
DRIPS: '0xa0523b86472561f0859d84C094cc04e6c4B33169',
NFT_DRIVER: '0xc95eb214845d5693abc750692161CB008796ae5C',
NFT_DRIVER_ID: '1',
ADDRESS_DRIVER: '0x28AA985982fE7900cb789793c138FAB682248fb1',
ADDRESS_DRIVER: '0xcc137285FD4D8914Dae08629086309B89aA6FDef',
DRIPS_LOGIC: '0xD0BBd70EA014bFEC48da174EdF908EC30a5ba9F1',
ADDRESS_DRIVER_ID: '0',
NFT_DRIVER_LOGIC: '0xE87874DBF1c3a1D8B4f4cB44d736C53987e0cC5e',
ADDRESS_DRIVER_LOGIC: '0xB1A29A3fe16eB40655e239e88B61aB84a9bf0397',
IMMUTABLE_SPLITS_DRIVER: '0xaD2E5BECB55D12bc6D011c70226b82E642fFCF14',
NFT_DRIVER_LOGIC: '0x1Dee3E2d70d41160D5AC80FB93986baE5D69A42e',
ADDRESS_DRIVER_LOGIC: '0x7adB68BB8b9C20109fCeeDe40C36E5263D426746',
IMMUTABLE_SPLITS_DRIVER: '0xEC8493BdbBbBe22a6F54573cFeE23ac8Ab90dF77',
IMMUTABLE_SPLITS_DRIVER_ID: '2',
IMMUTABLE_SPLITS_DRIVER_LOGIC: '0x8291604630CcAd6E716792350bB2301f38E5CaF5',
REPO_DRIVER: '0x70F397E19fBc78f1F2090C3F4137BEd4fAD5C79e',
IMMUTABLE_SPLITS_DRIVER_LOGIC: '0xB3106163A116F538f03dFd3FEAB0eb59979ebeDE',
REPO_DRIVER: '0xb9C8e18E82687a564Ac4D26E22D28a4C95057CE9',
REPO_DRIVER_LOGIC: '0xb6495F3c4384959ce679955DE520a5910eedcdc9',
REPO_DRIVER_ADMIN: '0xFAdDb8777bf0445aBb85DA2d1889836BaCC5C9A3',
REPO_DRIVER_ID: '3',
Expand Down
Loading