You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -309,7 +309,7 @@ After that you can check all results in [http://localhost:8080/webdriver-ts/tabl
309
309
3. Visit your page in the browser (URL follows the folder structure): `http://localhost:8080/frameworks/keyed/fast/index.html`
310
310
4. Note: Its important to always start the server from the root, because that way you'll get access to global CSS that all apps must share
311
311
5. Add the "action triggers" - buttons that all apps must have (see `frameworks/keyed/vanillajs/index.html`)
312
-
1. Note: Action triggers are simply buttons that are used to run the benchmarks (adding rows, deleting rows, swapping them, etc). Those buttons can be static HTML, or you can render them with your framework of choice
312
+
1. Note: Action triggers are simply buttons that are used to run the benchmarks (adding rows, deleting rows, swapping them, etc). Those buttons can be static HTML, or you can render them dynamically (with JS) with your framework of choice
313
313
2. Make sure your HTML elements have the same classes and structure as VanillaJS, otherwise benchmarks won't be able to find your elements on the page, and you will not get the global CSS (Bootstrap)
314
314
3. Add the html example below and open the page. You should see nicely formatted elements on the page, like in the GIF image below.
315
315
4. Example for action triggers
@@ -392,7 +392,7 @@ After that you can check all results in [http://localhost:8080/webdriver-ts/tabl
392
392
6. Generate dummy data for rendering
393
393
1. See `frameworks/keyed/fast/src/utils/build-dummy-data.ts` as an example
394
394
2. Note: `id` is an important attribute and it must be initialized as `1`, and continuously incremented. The only time `id` resets back to `1` is when the page reloads - otherwise it should just keep incrementing each time a new row is created. Doing anything else will cause errors when benchmarks try to find elements with specific IDs. Trust me, I learned the hard way.
395
-
7. . Your app needs to support several actions that correspond to "Action triggers" listed above. Here's an example from Fast framework:
395
+
7. . Your app needs to support several actions that correspond to "Action triggers" listed above. Here's an example from Fast framework `frameworks\keyed\fast\src\App.ts` and `frameworks\keyed\fast\src\components\Table.ts`:
396
396
1. Code example:
397
397
```typescript
398
398
export class BenchmarkApp extends FASTElement {
@@ -404,25 +404,29 @@ After that you can check all results in [http://localhost:8080/webdriver-ts/tabl
404
404
swapTwoRows() {}
405
405
deleteSingleRow(rowId: number) {}
406
406
}
407
+
408
+
export class Table extends FASTElement {
409
+
selectRow(rowId: number) {}
410
+
}
407
411
```
408
-
2. Note: your app doesn't need methods with the same name - you should write idiomatic code and follow the best practices of your framework of choice. The example above is just to give you an idea of which operations must be supported, but how you choose to implement those methods can be very different from one framework to the next.
409
-
8. Manually testing your app - do this before you run the benchmarks
412
+
1. Note: your app doesn't need methods with the same name - you should write idiomatic code and follow the best practices of your framework of choice. The example above is just to give you an idea of which operations must be supported, but how you choose to implement those methods can be very different from one framework to the next.
413
+
1. Manually testing your app - do this before you run the benchmarks
410
414
1. Open your page and click on the buttons, make sure your app adds 1000 rows, then removes them, or swaps them, or adds/removes 10,000 rows.
411
415
2. To do this, you'll probably need to watch your local files and compile them into some sort of a bundle, like `frameworks\keyed\fast\dist\bundle.js` which will be loaded through a script tag in your HTML file
412
416
3. For example, in Fast folder we have webpack watching our files: ` "build-dev": "rimraf dist && webpack --config webpack.config.js --watch --mode=development",`
413
417
4. That means we have two terminal tabs running
414
418
1. One for the server from the root folder `npm start`
415
419
2. And another in our local folder where webpack is watching the files
416
-
9. Run the single benchmark for your framework
420
+
2. Run the single benchmark for your framework
417
421
1. Once you manually verified that everything works as expected, run a single benchmark and make sure all of the tests are running
418
422
2. If you forgot something, one of the benchmarks will probably fail - for example it won't be able to find an element on the page or similar
419
423
3. Keep the server in the root folder running `npm start`, and in another terminal tab, also from the root folder run `npm run bench -- --framework keyed/fast` (or whatever is your framework `keyed/react`, `keyed/angular`, etc.).
420
424
4. The benchmark runner will open and close Chrome multiple times. The whole thing will take a couple of minutes.
421
-
10. Optional: run the benchmark for VanillaJS as comparison
425
+
3. Optional: run the benchmark for VanillaJS as comparison
422
426
1. ` npm run bench -- --framework keyed/vanillajs`
423
-
11. Build the report
427
+
4. Build the report
424
428
1. `npm run results`
425
-
12. Open the report in your browser (NOTE: the server must still be running if you want to see this page)
429
+
5. Open the report in your browser (NOTE: the server must still be running if you want to see this page)
0 commit comments