Skip to content

Commit d25c2e2

Browse files
authored
fix: remove cypress iframe package (#1125)
1 parent 8ec5b8d commit d25c2e2

File tree

6 files changed

+808
-652
lines changed

6 files changed

+808
-652
lines changed

cypress/e2e/builder/item/apps/apps.cy.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { ItemType, PackedAppItemFactory } from '@graasp/sdk';
22

3-
import 'cypress-iframe';
4-
53
import { buildAppItemLinkForTest } from '../../fixtures/apps';
64
import { buildItemPath } from '../../utils';
75

cypress/e2e/player/apps.cy.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'cypress-iframe';
2-
31
import {
42
APP_USING_CONTEXT_ITEM,
53
PUBLIC_APP_USING_CONTEXT_ITEM,
@@ -28,7 +26,7 @@ describe('Apps', () => {
2826

2927
cy.wait(3000);
3028
const iframeSelector = `iframe[title="${name}"]`;
31-
cy.frameLoaded(iframeSelector);
29+
cy.iframe(iframeSelector);
3230

3331
// check app receives successfully the context
3432
clickElementInIframe(iframeSelector, '#requestContext');
@@ -76,7 +74,7 @@ describe('Public Apps', () => {
7674
it('Public App should request context', () => {
7775
cy.wait(3000);
7876
const iframeSelector = `iframe[title="${name}"]`;
79-
cy.frameLoaded(iframeSelector);
77+
cy.iframe(iframeSelector);
8078

8179
// check app receives successfully the context
8280
clickElementInIframe(iframeSelector, '#requestContext');

cypress/e2e/player/shortcut.cy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
PackedShortcutItemFactory,
44
} from '@graasp/sdk';
55

6-
import 'cypress-iframe';
76
import { v4 } from 'uuid';
87

98
import {

cypress/support/commands.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ import { ApiConfig } from './types';
171171
declare global {
172172
namespace Cypress {
173173
interface Chainable {
174+
iframe(selector: string): Chainable;
175+
174176
checkErrorTextField(id: string, flag: unknown): Chainable;
175177

176178
signUpAndCheck(
@@ -834,3 +836,11 @@ Cypress.Commands.add('disableLocalStorage', () => {
834836
}
835837
});
836838
});
839+
840+
const waitForIframe = (selector: string) => {
841+
cy.get(selector)
842+
.its('0.contentDocument.body')
843+
.should('not.be.empty')
844+
.then(cy.wrap);
845+
};
846+
Cypress.Commands.add('iframe', waitForIframe);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@
172172
"@vitest/ui": "3.2.4",
173173
"concurrently": "9.2.1",
174174
"cypress": "15.2.0",
175-
"cypress-iframe": "1.0.1",
176175
"env-cmd": "10.1.0",
177176
"eslint": "9.25.1",
178177
"eslint-config-prettier": "10.1.5",
@@ -189,6 +188,7 @@
189188
"jose": "5.10.0",
190189
"nock": "13.5.6",
191190
"nyc": "17.1.0",
191+
"oxlint": "1.19.0",
192192
"playwright": "1.52.0",
193193
"prettier": "3.6.2",
194194
"storybook": "9.1.5",

0 commit comments

Comments
 (0)