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

feat(web): added ai cache capability #18

Merged
merged 43 commits into from
Aug 1, 2024
Merged

feat(web): added ai cache capability #18

merged 43 commits into from
Aug 1, 2024

Conversation

zhoushaw
Copy link
Member

Usecase

- playwright test
+ MIDSCENE_CACHE=true playwright test

Generate ai snapshot results

image

Effect

image

Reuse strategy

  • The same test cases
  • The same prompt,
  • The same page elements found are reused

Copy link

netlify bot commented Jul 31, 2024

Deploy Preview for midscene ready!

Name Link
🔨 Latest commit 7fb4c5b
🔍 Latest deploy log https://app.netlify.com/sites/midscene/deploys/66ab3b3f454f470007af9675
😎 Deploy Preview https://deploy-preview-18--midscene.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

const origin = this.aiVendorFn;
this.aiVendorFn<T> = aiVendorFn;
return () => {
this.aiVendorFn = origin;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should rename the case name: xicha -> online_order

const combined = JSON.stringify({ content, rect });
// Generates the ha-256 hash value
// @ts-expect-error
const hashHex = SHA256(combined);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return {
output: {
element,
},
log: {
dump: insightDump,
},
cache: {
hint: Boolean(locateResult),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hit, not hint

@zhoushaw zhoushaw merged commit cd775af into main Aug 1, 2024
5 checks passed
@zhoushaw zhoushaw deleted the feat/add-cache-logic branch August 1, 2024 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants