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

Release 20240215 #40

Merged
merged 11 commits into from
Feb 15, 2024
4 changes: 2 additions & 2 deletions e2e/desktop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ test.use(devices["Desktop Chrome"]);

test.describe("Given a desktop browser", async () => {
test.describe("When opening a Publication link", async () => {
test("Then it should omit mobile apps options", async ({ textPost }) => {
test("Then it should omit mobile-only apps", async ({ textPost }) => {
await textPost.open();

await expect(textPost.options).not.toHaveText(["Orb", "Phaver", "Buttrfly"]);
await expect(textPost.options).not.toHaveText(["Phaver"]);
});
});
});
17 changes: 6 additions & 11 deletions e2e/fixtures/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ import { test as base, expect } from "@playwright/test";
import { ProfilePage } from "./ProfilePage";

export const test = base.extend<{
v1Profile: ProfilePage;
v1ProfileWithSuffix: ProfilePage;
v2Profile: ProfilePage;
lensProfile: ProfilePage;
anyProfile: ProfilePage;
}>({
v1Profile: async ({ page }, use) => {
const profile = new ProfilePage(page, "lensprotocol");
lensProfile: async ({ page }, use) => {
const profile = new ProfilePage(page, "lens/lens");
await use(profile);
},
v1ProfileWithSuffix: async ({ page }, use) => {
const profile = new ProfilePage(page, "lensprotocol.lens");
await use(profile);
},
v2Profile: async ({ page }, use) => {
const profile = new ProfilePage(page, "lens/lensprotocol");
anyProfile: async ({ page }, use) => {
const profile = new ProfilePage(page, "lens/stani");
await use(profile);
},
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.describe("Given a mobile browser", async () => {
test("Then it should show in order mobile and web apps options", async ({ textPost }) => {
await textPost.open();

await expect(textPost.options).toHaveText(["Buttrfly", "Orb", "Hey", "Lensta", "Soclly"]);
await expect(textPost.options).toHaveText(["Buttrfly", "Hey", "orb", "Soclly"]);
});
});
});
172 changes: 41 additions & 131 deletions e2e/profiles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ test.use(devices["Desktop Chrome"]);

test.describe("Given a Profile link", async () => {
test.describe("When opening it", async () => {
test("Then it should show relevant app options", async ({ v1Profile }) => {
await v1Profile.open();
test("Then it should show relevant app options", async ({ anyProfile }) => {
await anyProfile.open();

await expect(v1Profile.options).toHaveText([
await expect(anyProfile.options).toHaveText([
"Buttrfly",
"Collectz",
"Hey",
"LensFrens",
"Lensta",
"orb",
"Orna",
"Riff",
"Soclly",
"Tape",
Expand All @@ -23,90 +22,28 @@ test.describe("Given a Profile link", async () => {
});
});

test.describe("Given a v1 Profile link posted on a social media website/app", async () => {
test.describe("When checking Open Graph meta tags", async () => {
test("Then it should render the expected base-line meta tags", async ({ v1Profile }) => {
await v1Profile.open();

expect(await v1Profile.extractOpenGraphProperties()).toMatchObject({
"og:title": `lens/${v1Profile.handle} profile`,
"og:description": "The Social Layer for Web3 🌿",
"og:url": expect.stringContaining(`/u/lens/${v1Profile.handle}`),
"og:site_name": "Lens Share",
"og:type": "profile",
});
});

test("Then it should include the expected Twitter Card meta tags", async ({ v1Profile }) => {
await v1Profile.open();

expect(await v1Profile.extractTwitterMetaTags()).toEqual({
"twitter:card": "summary_large_image",
"twitter:site": "LensProtocol",
"twitter:title": `lens/${v1Profile.handle} profile`,
"twitter:description": "The Social Layer for Web3 🌿",
"twitter:image": expect.any(String),
"twitter:image:type": "image/png",
});
});
});
});

test.describe("Given a v1 Profile link with suffix posted on a social media website/app", async () => {
test.describe("When checking Open Graph meta tags", async () => {
test("Then it should render the expected base-line meta tags", async ({
v1ProfileWithSuffix,
}) => {
await v1ProfileWithSuffix.open();

expect(await v1ProfileWithSuffix.extractOpenGraphProperties()).toMatchObject({
"og:title": `lens/lensprotocol profile`,
"og:description": "The Social Layer for Web3 🌿",
"og:url": expect.stringContaining(`/u/lens/lensprotocol`),
"og:site_name": "Lens Share",
"og:type": "profile",
});
});

test("Then it should include the expected Twitter Card meta tags", async ({
v1ProfileWithSuffix,
}) => {
await v1ProfileWithSuffix.open();

expect(await v1ProfileWithSuffix.extractTwitterMetaTags()).toEqual({
"twitter:card": "summary_large_image",
"twitter:site": "LensProtocol",
"twitter:title": `lens/lensprotocol profile`,
"twitter:description": "The Social Layer for Web3 🌿",
"twitter:image": expect.any(String),
"twitter:image:type": "image/png",
});
});
});
});

test.describe("Given a v2 Profile link posted on a social media website/app", async () => {
test.describe("Given a Profile link posted on a social media website/app", async () => {
test.describe("When checking Open Graph meta tags", async () => {
test("Then it should render the expected base-line meta tags", async ({ v2Profile }) => {
await v2Profile.open();
test("Then it should render the expected base-line meta tags", async ({ lensProfile }) => {
await lensProfile.open();

expect(await v2Profile.extractOpenGraphProperties()).toMatchObject({
"og:title": `${v2Profile.handle} profile`,
"og:description": "The Social Layer for Web3 🌿",
"og:url": expect.stringContaining(`/u/${v2Profile.handle}`),
expect(await lensProfile.extractOpenGraphProperties()).toMatchObject({
"og:title": `${lensProfile.handle} profile`,
"og:description": "onchain social",
"og:url": expect.stringContaining(`/u/${lensProfile.handle}`),
"og:site_name": "Lens Share",
"og:type": "profile",
});
});

test("Then it should include the expected Twitter Card meta tags", async ({ v2Profile }) => {
await v2Profile.open();
test("Then it should include the expected Twitter Card meta tags", async ({ lensProfile }) => {
await lensProfile.open();

expect(await v2Profile.extractTwitterMetaTags()).toEqual({
expect(await lensProfile.extractTwitterMetaTags()).toEqual({
"twitter:card": "summary_large_image",
"twitter:site": "LensProtocol",
"twitter:title": `${v2Profile.handle} profile`,
"twitter:description": "The Social Layer for Web3 🌿",
"twitter:title": `${lensProfile.handle} profile`,
"twitter:description": "onchain social",
"twitter:image": expect.any(String),
"twitter:image:type": "image/png",
});
Expand All @@ -117,26 +54,22 @@ test.describe("Given a v2 Profile link posted on a social media website/app", as
test.describe("Given a Profile link posted on a social media website/app", async () => {
test.describe("When the link includes the `by` attribution param", async () => {
test("Then it should mention the originating app in page `title` and Open Graph `site_name` tag", async ({
v1Profile,
anyProfile,
}) => {
await v1Profile.openAsSharedBy("Hey");
await anyProfile.openAsSharedBy("Hey");

expect(await v1Profile.getTitle()).toContain("Hey");
expect(await v1Profile.extractOpenGraphProperties()).toMatchObject({
expect(await anyProfile.getTitle()).toContain("Hey");
expect(await anyProfile.extractOpenGraphProperties()).toMatchObject({
"og:site_name": "Hey",
});
});

test("Then it should mention the originating app in Twitter Card `site` if a Twitter handle is provided in the app manifest", async ({
v1Profile,
anyProfile,
}) => {
await v1Profile.openAsSharedBy("Hey");
await anyProfile.openAsSharedBy("Hey");

expect(await v1Profile.getTitle()).toContain("Hey");
expect(await v1Profile.extractOpenGraphProperties()).toMatchObject({
"og:site_name": "Hey",
});
expect(await v1Profile.extractTwitterMetaTags()).toMatchObject({
expect(await anyProfile.extractTwitterMetaTags()).toMatchObject({
"twitter:site": "heydotxyz",
});
});
Expand All @@ -145,15 +78,14 @@ test.describe("Given a Profile link posted on a social media website/app", async

test.describe("Given a Profile link with `by` attribution param", async () => {
test.describe("When opening it", async () => {
test("Then it should show the specified app first", async ({ v1Profile }) => {
await v1Profile.openAsSharedBy("Hey");
test("Then it should show the specified app first", async ({ anyProfile }) => {
await anyProfile.openAsSharedBy("Hey");

await expect(v1Profile.options).toHaveText([
await expect(anyProfile.options).toHaveText([
"Hey",
"Buttrfly",
"Collectz",
"LensFrens",
"Lensta",
"orb",
"Orna",
"Riff",
"Soclly",
"Tape",
Expand All @@ -163,55 +95,33 @@ test.describe("Given a Profile link with `by` attribution param", async () => {

test.describe("When opening it on a platform not supported by the specified app", async () => {
test("Then it should show a message an attribution message before offering other options", async ({
v1Profile,
anyProfile,
}) => {
await v1Profile.openAsSharedBy("orb");

await expect(v1Profile.context).toHaveText("Shared via Orb mobile app.");
});
});
});

test.describe("Given an opened v1 Profile link", async () => {
test.describe("When submitting an app choice", async () => {
test("Then it should open the publication with the selected app", async ({ v1Profile }) => {
await v1Profile.open();
const url = await v1Profile.justOnce("Hey");

expect(url).toMatch(`https://hey.xyz/u/lens/${v1Profile.handle}`);
});
});

test.describe("When submitting an app choice with 'Remember' checkbox selected", async () => {
test("Then it should use the same app for all future publications", async ({ v1Profile }) => {
await v1Profile.open();
await v1Profile.remember("Hey");

const response = await v1Profile.open();
await anyProfile.openAsSharedBy("phaver");

expect(response?.url()).toMatch(`https://hey.xyz/u/lens/${v1Profile.handle}`);
await expect(anyProfile.context).toHaveText("Shared via Phaver.");
});
});
});

test.describe("Given an opened v2 Profile link", async () => {
test.describe("When submitting an app choice", async () => {
test("Then it should open the publication with the selected app", async ({ v2Profile }) => {
await v2Profile.open();
const url = await v2Profile.justOnce("Hey");
test("Then it should open the publication with the selected app", async ({ anyProfile }) => {
await anyProfile.open();
const url = await anyProfile.justOnce("Hey");

expect(url).toMatch(`https://hey.xyz/u/${v2Profile.handle}`);
expect(url).toMatch(`https://hey.xyz/u/${anyProfile.handle}`);
});
});

test.describe("When submitting an app choice with 'Remember' checkbox selected", async () => {
test("Then it should use the same app for all future publications", async ({ v2Profile }) => {
await v2Profile.open();
await v2Profile.remember("Hey");
test("Then it should use the same app for all future publications", async ({ anyProfile }) => {
await anyProfile.open();
await anyProfile.remember("Hey");

const response = await v2Profile.open();
const response = await anyProfile.open();

expect(response?.url()).toMatch(`https://hey.xyz/u/${v2Profile.handle}`);
expect(response?.url()).toMatch(`https://hey.xyz/u/${anyProfile.handle}`);
});
});
});
30 changes: 19 additions & 11 deletions e2e/publications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ test.describe("Given a Publication link", async () => {
test("Then it should show relevant app options", async ({ imagePost }) => {
await imagePost.open();

await expect(imagePost.options).toHaveText([
"Buttrfly",
"Collectz",
"Hey",
"Lensta",
"Soclly",
]);
await expect(imagePost.options).toHaveText(["Buttrfly", "Hey", "orb", "Orna", "Soclly"]);
});
});
});
Expand Down Expand Up @@ -117,7 +111,14 @@ test.describe("Given a Video Publication link", async () => {
}) => {
await videoPost.open();

await expect(videoPost.options).toHaveText(["Buttrfly", "Collectz", "Hey", "Soclly", "Tape"]);
await expect(videoPost.options).toHaveText([
"Buttrfly",
"Hey",
"orb",
"Orna",
"Soclly",
"Tape",
]);
});
});
});
Expand All @@ -127,17 +128,24 @@ test.describe("Given a Publication link with `by` attribution param", async () =
test("Then it should show the specified app first", async ({ videoPost }) => {
await videoPost.openAsSharedBy("tape");

await expect(videoPost.options).toHaveText(["Tape", "Buttrfly", "Collectz", "Hey", "Soclly"]);
await expect(videoPost.options).toHaveText([
"Tape",
"Buttrfly",
"Hey",
"orb",
"Orna",
"Soclly",
]);
});
});

test.describe("When opening it on a platform not supported by the specified app", async () => {
test("Then it should show a message an attribution message before offering other options", async ({
videoPost,
}) => {
await videoPost.openAsSharedBy("orb");
await videoPost.openAsSharedBy("phaver");

await expect(videoPost.context).toHaveText("Shared via Orb mobile app.");
await expect(videoPost.context).toHaveText("Shared via Phaver.");
});
});
});
Expand Down
20 changes: 0 additions & 20 deletions manifests/buttrfly-web.json

This file was deleted.

2 changes: 1 addition & 1 deletion manifests/buttrfly.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"appId": "buttrfly",
"name": "Buttrfly",
"description": "Web3 Social Explorer",
"platform": "mobile",
"platform": "web",
"icon": {
"url": "https://buttrfly.app/buttrfly-icon-rounded.png",
"background": "#111111"
Expand Down
Loading
Loading