diff --git a/.github/workflows/guides.yml b/.github/workflows/guides.yml index 17c37d277..9b5f5330a 100644 --- a/.github/workflows/guides.yml +++ b/.github/workflows/guides.yml @@ -42,8 +42,7 @@ jobs: matrix: # note: must match the names in test.spec.ts guide: - - "counter-dapp" - - "intro to sway" + - "counter-dapp" - "intro to predicates" - "quickstart" diff --git a/docs/guides/examples/counter-dapp/counter-contract/Cargo.lock b/docs/guides/examples/counter-dapp/counter-contract/Cargo.lock index 35bed9de0..8a1501bf9 100644 --- a/docs/guides/examples/counter-dapp/counter-contract/Cargo.lock +++ b/docs/guides/examples/counter-dapp/counter-contract/Cargo.lock @@ -888,9 +888,9 @@ dependencies = [ [[package]] name = "fuel-asm" -version = "0.56.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122c27ab46707017063bf1c6e0b4f3de881e22e81b4059750a0dc95033d9cc26" +checksum = "711b83807968cd62babe6cd70c94b76c86f302c8573da18b3c69135688eceecd" dependencies = [ "bitflags 2.6.0", "fuel-types", @@ -900,9 +900,9 @@ dependencies = [ [[package]] name = "fuel-core-chain-config" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "318a5a9733255cffac64a4b5acf6a7f41e438bec3ead506fc9f74730ce956528" +checksum = "7a4c5a71702426b8354bff2010131c0abb4a4f0b608cc7a6dfd72f9e785ba478" dependencies = [ "anyhow", "bech32", @@ -920,9 +920,9 @@ dependencies = [ [[package]] name = "fuel-core-client" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ad219bde52b072a2d828f27072982047a77cc02c953ea7e83c23de586d466d" +checksum = "5770dbda6220e641eb57ee204dd5914fa15170afe3009473f57cdf15e2339fd8" dependencies = [ "anyhow", "cynic", @@ -944,9 +944,9 @@ dependencies = [ [[package]] name = "fuel-core-metrics" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88eb1bd81016b49493181b8bc29526678229350a780d4d04db137415028db179" +checksum = "8f671e9e813b81873ef07e1cfe8697ba3f9fd0f05313879ed0933446da4c1c14" dependencies = [ "parking_lot", "pin-project-lite", @@ -957,9 +957,9 @@ dependencies = [ [[package]] name = "fuel-core-poa" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef478ff684ee6c2eac57070322ba05525842670576328414da7fd6c40af4e25" +checksum = "9b698e7c184ab4acbaabe7bad73fdc7dfc9ebfc3a6856b1d719a4fd4c1921873" dependencies = [ "anyhow", "async-trait", @@ -976,9 +976,9 @@ dependencies = [ [[package]] name = "fuel-core-services" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064b31213ea0b56f6558a0493b264cbd79e060a56de2bd35f8a10d7e78f526fa" +checksum = "998a4f9d057bf3efe43be574bd200ef64c3318007fd04523ce6bd51cc7bb963c" dependencies = [ "anyhow", "async-trait", @@ -991,9 +991,9 @@ dependencies = [ [[package]] name = "fuel-core-storage" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f06320744b7d53bc7928d1a40a28fd697191a5b6938a353164231a3423ebdcd9" +checksum = "1daa7422e48120b1623b53fe1a1152d11314f30fb290a73dc80f7e128c1f9014" dependencies = [ "anyhow", "derive_more", @@ -1013,9 +1013,9 @@ dependencies = [ [[package]] name = "fuel-core-types" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84fda0c6dc7b3bd24a993b3902f55862b8db0fa6de5b0f1d45f5942bc59792eb" +checksum = "7aa1c54f09cc7c29a11ca1129f73105745f8374a192e3e24040c10822871d83f" dependencies = [ "anyhow", "bs58", @@ -1031,9 +1031,9 @@ dependencies = [ [[package]] name = "fuel-crypto" -version = "0.56.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33548590131674e8f272a3e056be4dbaa1de7cb364eab2b17987cd5c0dc31cb0" +checksum = "e5a4ca62d0a8a361b66a6eab3456285883d0aa92c407e249fc76f195c332fbb2" dependencies = [ "coins-bip32", "coins-bip39", @@ -1052,9 +1052,9 @@ dependencies = [ [[package]] name = "fuel-derive" -version = "0.56.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f49fdbfc1615d88d2849650afc2b0ac2fecd69661ebadd31a073d8416747764" +checksum = "9ca99d9c264fec231a01e55bbdb6adb3080266dc44c4cc88de870b089ee2a015" dependencies = [ "proc-macro2", "quote", @@ -1064,9 +1064,9 @@ dependencies = [ [[package]] name = "fuel-merkle" -version = "0.56.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf17ce8ee5e8b573ea584c223635ff09f1288ad022bcf662954fdccb907602eb" +checksum = "02f3c08f22f7c24170a4ac255e7dfe52d52ae2e85c4a8e26ed6df4f1bd380210" dependencies = [ "derive_more", "digest", @@ -1079,15 +1079,15 @@ dependencies = [ [[package]] name = "fuel-storage" -version = "0.56.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c1b711f28553ddc5f3546711bd220e144ce4c1af7d9e9a1f70b2f20d9f5b791" +checksum = "d676ea5d926bf90c8ea442e5f6fc23c0e86c2e4d663f303842b4afe5b7928084" [[package]] name = "fuel-tx" -version = "0.56.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13aae44611588d199dd119e4a0ebd8eb7ae4cde6bf8b4d12715610b1f5e5b731" +checksum = "86158d08fe2a936ac765a1e2cb9bf60be704203b3085882e7cc6cd4c48de38ef" dependencies = [ "bitflags 2.6.0", "derivative", @@ -1108,9 +1108,9 @@ dependencies = [ [[package]] name = "fuel-types" -version = "0.56.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b6fb26bcb408b6897e603f68cf60bbbaf6d15381c99f54a69ea743a58235ac1" +checksum = "42b4430c6a20669fffd8f2c17d2be6809a356f623243a78b5eedf8ba7897c036" dependencies = [ "fuel-derive", "hex", @@ -1120,9 +1120,9 @@ dependencies = [ [[package]] name = "fuel-vm" -version = "0.56.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64fc4695efac9207276f6229f2dd9811848b328a13604a698f7bce1d452bd986" +checksum = "b1b04a4e971d58b3662ff8b84b3176094e25f4b372728a13ea903fdf79c7e426" dependencies = [ "anyhow", "async-trait", @@ -1154,9 +1154,9 @@ dependencies = [ [[package]] name = "fuels" -version = "0.66.4" +version = "0.66.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9699101cadc9ad3f1eff2a71532d755ab5526419414b99702e89c1d8b92b5938" +checksum = "aaf7ca0443308f4c3d3e9dd7ed67cb18369ae63d208302056d6d5f3a09efb031" dependencies = [ "fuel-core-client", "fuel-crypto", @@ -1170,9 +1170,9 @@ dependencies = [ [[package]] name = "fuels-accounts" -version = "0.66.4" +version = "0.66.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e97cf3bb16c8b6436dd6e3a6f9cea5c1ffda8daf7cdb335c60b74c31572f57" +checksum = "92ea69afa418ba67b9572a5b4cb612b80ee2113c9f755e93acf7adc9fc1454d1" dependencies = [ "async-trait", "chrono", @@ -1195,9 +1195,9 @@ dependencies = [ [[package]] name = "fuels-code-gen" -version = "0.66.4" +version = "0.66.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47552a5e8b6935595131ef38b14ef4eee8db870174ea62c8db804dbfa02f57d6" +checksum = "d8d1949debe40c9eb731a93b22a50da560007d85f6f7983679d217c01b9dc867" dependencies = [ "Inflector", "fuel-abi-types", @@ -1211,9 +1211,9 @@ dependencies = [ [[package]] name = "fuels-core" -version = "0.66.4" +version = "0.66.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b687c021466238851b07e2d39f974a614ffafc7e57dc9be00840d74c74c5febd" +checksum = "e720a87a7c99fcc5477cbb251738406de752a10eb237e15c79c1d99b64f4679f" dependencies = [ "async-trait", "bech32", @@ -1239,9 +1239,9 @@ dependencies = [ [[package]] name = "fuels-macros" -version = "0.66.4" +version = "0.66.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9dd9359ca6c0e7ad300d487e59babe03f64c6b7b169a0743d13f5c58837b589" +checksum = "f4f7b391259fceb75331bcbde2878cd9765b579e9167abd818641205b4c96b9a" dependencies = [ "fuels-code-gen", "itertools 0.12.1", @@ -1252,9 +1252,9 @@ dependencies = [ [[package]] name = "fuels-programs" -version = "0.66.4" +version = "0.66.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3288fc4b64e8f93a39b8ffa36fcaef8753232ffda5399662d28e24c172a7d00c" +checksum = "cbf719a68184ad4999c24dd53cf68bdd247d02fe16a9d67ccba177c8e44771b9" dependencies = [ "async-trait", "fuel-abi-types", @@ -1271,9 +1271,9 @@ dependencies = [ [[package]] name = "fuels-test-helpers" -version = "0.66.4" +version = "0.66.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11e18f84f11543ab29e787e2170eeed7f390b791f16ef8be363e3700ea21833d" +checksum = "8a615a59644d3cfce8dc1089db0764b4cca2bcea42b2a08eca826e2b8f892936" dependencies = [ "fuel-core-chain-config", "fuel-core-client", @@ -2502,9 +2502,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.26.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4124a35fe33ae14259c490fd70fa199a32b9ce9502f2ee6bc4f81ec06fa65894" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ "rand", "secp256k1-sys", @@ -2512,9 +2512,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" dependencies = [ "cc", ] diff --git a/docs/guides/examples/counter-dapp/counter-contract/Cargo.toml b/docs/guides/examples/counter-dapp/counter-contract/Cargo.toml index 2f94f69ba..eb1255f85 100644 --- a/docs/guides/examples/counter-dapp/counter-contract/Cargo.toml +++ b/docs/guides/examples/counter-dapp/counter-contract/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Fuel Labs "] license = "Apache-2.0" [dev-dependencies] -fuels = "0.66.1" +fuels = { version = "0.66.5" } tokio = { version = "1.12", features = ["rt", "macros"] } [[test]] diff --git a/docs/guides/examples/counter-dapp/counter-contract/Forc.lock b/docs/guides/examples/counter-dapp/counter-contract/Forc.lock index 4f244b9df..c3b798b28 100644 --- a/docs/guides/examples/counter-dapp/counter-contract/Forc.lock +++ b/docs/guides/examples/counter-dapp/counter-contract/Forc.lock @@ -1,6 +1,6 @@ [[package]] name = "core" -source = "path+from-root-E4CD68293365AD96" +source = "path+from-root-4BB20845430AF9CF" [[package]] name = "counter-contract" @@ -9,5 +9,5 @@ dependencies = ["std"] [[package]] name = "std" -source = "git+https://github.com/fuellabs/sway?rev#31a1d6f98395f571cd3674b492d9bf4773c55f65" +source = "git+https://github.com/fuellabs/sway?tag=v0.63.5#31a1d6f98395f571cd3674b492d9bf4773c55f65" dependencies = ["core"] diff --git a/tests/test.spec.ts b/tests/test.spec.ts index 27c99920f..13b058a64 100644 --- a/tests/test.spec.ts +++ b/tests/test.spec.ts @@ -1,16 +1,16 @@ -import { test } from "./utils/fixtures"; -import { runTest } from "./utils/runTest"; -import { setupFolders, startServers, stopServers } from "./utils/setup"; -import { useFuelWallet } from "./utils/wallet"; +import { test } from './utils/fixtures'; +import { runTest } from './utils/runTest'; +import { setupFolders, startServers, stopServers } from './utils/setup'; +import { useFuelWallet } from './utils/wallet'; -test.describe("Guides", () => { - test("quickstart", async ({ context, extensionId, page }) => { - const CONTRACT_QUICKSTART_PAGE_URL = "guides/contract-quickstart"; +test.describe('Guides', () => { + test('quickstart', async ({ context, extensionId, page }) => { + const CONTRACT_QUICKSTART_PAGE_URL = 'guides/contract-quickstart'; // SETUP stopServers(); await useFuelWallet(context, extensionId, page); - await setupFolders("fuel-project"); + await setupFolders('fuel-project'); await startServers(page); // TEST CONTRACT QUICKSTART @@ -21,14 +21,14 @@ test.describe("Guides", () => { // context.close(); }); - test("counter-dapp", async ({ context, extensionId, page }) => { - const CONTRACT_PAGE_URL = "guides/counter-dapp/building-a-smart-contract"; - const FRONTEND_PAGE_URL = "guides/counter-dapp/building-a-frontend"; + test('counter-dapp', async ({ context, extensionId, page }) => { + const CONTRACT_PAGE_URL = 'guides/counter-dapp/building-a-smart-contract'; + const FRONTEND_PAGE_URL = 'guides/counter-dapp/building-a-frontend'; // SETUP stopServers(); await useFuelWallet(context, extensionId, page); - await setupFolders("fuel-project"); + await setupFolders('fuel-project'); await startServers(page); // TEST CONTRACT @@ -42,60 +42,60 @@ test.describe("Guides", () => { // context.close(); }); - test("intro to sway", async ({ context, extensionId, page }) => { - const PREREQUISITES_PAGE_URL = "guides/intro-to-sway/prerequisites"; - const IMPORTS_PAGE_URL = "guides/intro-to-sway/contract-imports"; - const STRUCTS_PAGE_URL = "guides/intro-to-sway/contract-structs"; - const ABI_PAGE_URL = "guides/intro-to-sway/contract-abi"; - const STORAGE_PAGE_URL = "guides/intro-to-sway/contract-storage"; - const ERRORS_PAGE_URL = "guides/intro-to-sway/contract-errors"; - const FUNCTIONS_PAGE_URL = "guides/intro-to-sway/contract-functions"; - const CHECKPOINT_PAGE_URL = "guides/intro-to-sway/checkpoint"; - const FUELS_RS_PAGE_URL = "guides/intro-to-sway/rust-sdk"; - const FUELS_TS_PAGE_URL = "guides/intro-to-sway/typescript-sdk"; - - // SETUP - stopServers(); - await useFuelWallet(context, extensionId, page); - await setupFolders("fuel-project"); - await startServers(page); - - // TEST CONTRACT - await runTest(page, context, PREREQUISITES_PAGE_URL); - await runTest(page, context, IMPORTS_PAGE_URL); - await runTest(page, context, STRUCTS_PAGE_URL); - await runTest(page, context, ABI_PAGE_URL); - await runTest(page, context, STORAGE_PAGE_URL); - await runTest(page, context, ERRORS_PAGE_URL); - await runTest(page, context, FUNCTIONS_PAGE_URL); - await runTest(page, context, CHECKPOINT_PAGE_URL); - await runTest(page, context, FUELS_RS_PAGE_URL); - await runTest(page, context, FUELS_TS_PAGE_URL); - - // SHUT DOWN - stopServers(); - // context.close(); - }); - - test("intro to predicates", async ({ context, extensionId, page }) => { - const PREREQUISITES_PAGE_URL = "guides/intro-to-predicates/prerequisites"; - const PREDICATE_ROOT_PAGE_URL = "guides/intro-to-predicates/predicate-root"; - const IMPORTS_PAGE_URL = "guides/intro-to-predicates/imports"; - const CONFIGURABLES_PAGE_URL = "guides/intro-to-predicates/configurables"; + // test("intro to sway", async ({ context, extensionId, page }) => { + // const PREREQUISITES_PAGE_URL = "guides/intro-to-sway/prerequisites"; + // const IMPORTS_PAGE_URL = "guides/intro-to-sway/contract-imports"; + // const STRUCTS_PAGE_URL = "guides/intro-to-sway/contract-structs"; + // const ABI_PAGE_URL = "guides/intro-to-sway/contract-abi"; + // const STORAGE_PAGE_URL = "guides/intro-to-sway/contract-storage"; + // const ERRORS_PAGE_URL = "guides/intro-to-sway/contract-errors"; + // const FUNCTIONS_PAGE_URL = "guides/intro-to-sway/contract-functions"; + // const CHECKPOINT_PAGE_URL = "guides/intro-to-sway/checkpoint"; + // const FUELS_RS_PAGE_URL = "guides/intro-to-sway/rust-sdk"; + // const FUELS_TS_PAGE_URL = "guides/intro-to-sway/typescript-sdk"; + + // // SETUP + // stopServers(); + // await useFuelWallet(context, extensionId, page); + // await setupFolders("fuel-project"); + // await startServers(page); + + // // TEST CONTRACT + // await runTest(page, context, PREREQUISITES_PAGE_URL); + // await runTest(page, context, IMPORTS_PAGE_URL); + // await runTest(page, context, STRUCTS_PAGE_URL); + // await runTest(page, context, ABI_PAGE_URL); + // await runTest(page, context, STORAGE_PAGE_URL); + // await runTest(page, context, ERRORS_PAGE_URL); + // await runTest(page, context, FUNCTIONS_PAGE_URL); + // await runTest(page, context, CHECKPOINT_PAGE_URL); + // await runTest(page, context, FUELS_RS_PAGE_URL); + // await runTest(page, context, FUELS_TS_PAGE_URL); + + // // SHUT DOWN + // stopServers(); + // // context.close(); + // }); + + test('intro to predicates', async ({ context, extensionId, page }) => { + const PREREQUISITES_PAGE_URL = 'guides/intro-to-predicates/prerequisites'; + const PREDICATE_ROOT_PAGE_URL = 'guides/intro-to-predicates/predicate-root'; + const IMPORTS_PAGE_URL = 'guides/intro-to-predicates/imports'; + const CONFIGURABLES_PAGE_URL = 'guides/intro-to-predicates/configurables'; const SIGNATURE_VERIFICATION_PAGE_URL = - "guides/intro-to-predicates/signature-verification"; - const MAIN_PAGE_URL = "guides/intro-to-predicates/main"; - const CHECKPOINT_PAGE_URL = "guides/intro-to-predicates/checkpoint"; + 'guides/intro-to-predicates/signature-verification'; + const MAIN_PAGE_URL = 'guides/intro-to-predicates/main'; + const CHECKPOINT_PAGE_URL = 'guides/intro-to-predicates/checkpoint'; const SCRIPT_DEBUG_PAGE_URL = - "guides/intro-to-predicates/debugging-with-scripts"; + 'guides/intro-to-predicates/debugging-with-scripts'; const SCRIPT_LOGS_PAGE_URL = - "guides/intro-to-predicates/debugging-with-scripts-rust"; - const FUELS_RS_PAGE_URL = "guides/intro-to-predicates/rust-sdk"; + 'guides/intro-to-predicates/debugging-with-scripts-rust'; + const FUELS_RS_PAGE_URL = 'guides/intro-to-predicates/rust-sdk'; // SETUP stopServers(); await useFuelWallet(context, extensionId, page); - await setupFolders("fuel-project"); + await setupFolders('fuel-project'); await startServers(page); // TEST CONTRACT diff --git a/tests/utils/runCommand.ts b/tests/utils/runCommand.ts index 96924f6ef..dbec96813 100644 --- a/tests/utils/runCommand.ts +++ b/tests/utils/runCommand.ts @@ -1,6 +1,7 @@ import { execSync } from 'child_process'; import { EOL } from 'os'; import type { Page } from '@playwright/test'; +import fs from 'fs'; import { clickCopyButton } from './button'; import { expect } from './fixtures'; @@ -21,7 +22,15 @@ export async function runCommand( command = preCommand + copied.text; } } - if (goToFolder) { +if (goToFolder) { + const projectPath = `guides-testing/${goToFolder}`; + if (fs.existsSync(projectPath)) { + console.log(`Directory ${projectPath} already exists. Deleting...`); + await fs.promises.rm(projectPath, { + recursive: true, + force: true, + }); + } command = `cd ${goToFolder} && ${command}`; } console.log('COMMAND', command); diff --git a/tests/utils/visit.ts b/tests/utils/visit.ts index 0f056169f..1f954ec74 100644 --- a/tests/utils/visit.ts +++ b/tests/utils/visit.ts @@ -2,7 +2,7 @@ import type { Page } from '@playwright/test'; export async function visit(page: Page, pathname: string) { console.log('GOING TO URL:', pathname); - await page.waitForTimeout(2000); + await page.waitForTimeout(5000); const pageFinal = await page.goto(`${pathname}`); await page.waitForTimeout(2000); return pageFinal;