-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add E2E tests to mimic FF Cloud Free Tier
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
test/e2e/frontend/cypress/tests-ee/free-tier/free-tier.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
describe('FlowFuse EE - Free Tier', () => { | ||
beforeEach(() => { | ||
cy.login('freddie', 'ffPassword') | ||
cy.home() | ||
}) | ||
|
||
it('shows that Hosted Instances are a premium feature in the side navigation', () => { | ||
cy.get('[data-nav="team-instances"]').get('[data-el="premium-feature"]').should('exist') | ||
}) | ||
|
||
it('shows that Hosted Instances are a premium feature when on the /team/<teamId>/instances page', () => { | ||
cy.get('[data-nav="team-instances"]').click() | ||
cy.get('[data-el="page-banner-feature-unavailable-to-team"]').should('exist') | ||
}) | ||
|
||
it('redirects to /application/devices after creating an Application when Hosted Instances are not enabled', () => { | ||
cy.get('[data-el="empty-state"] [data-action="create-application"]').click() | ||
cy.get('[data-form="application-name"] input[type="text"]').type('My Application') | ||
cy.get('[data-action="create-project"]').click() | ||
cy.url().should('include', '/devices') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,27 @@ const { Roles } = FF_UTIL.require('forge/lib/roles') | |
} | ||
}) | ||
|
||
// Mimic the FF Cloud "Free" Team Type | ||
const userFreddie = await factory.createUser({ username: 'freddie', name: 'Freddie Fett', email: '[email protected]', password: 'ffPassword', email_verified: true, password_expired: false }) | ||
const freeTeamType = await factory.createTeamType({ | ||
name: 'Free Team', | ||
description: 'team type description', | ||
active: true, | ||
order: 4, | ||
properties: { | ||
instances: { [flowforge.projectTypes[0].hashid]: { active: false } }, | ||
devices: {}, | ||
users: {}, | ||
features: {} | ||
} | ||
}) | ||
const freeTeam = await factory.createTeam({ | ||
name: 'FFeam', | ||
TeamTypeId: freeTeamType.id | ||
}) | ||
await factory.createSubscription(freeTeam) | ||
await freeTeam.addUser(userFreddie, { through: { role: Roles.Owner } }) | ||
|
||
// create a snapshot on DeviceB | ||
const deviceB = flowforge.applicationDevices.find((device) => device.name === 'application-device-b') | ||
await factory.createDeviceSnapshot({ name: 'application-device-b snapshot 1' }, deviceB, userTerry) | ||
|