-
Notifications
You must be signed in to change notification settings - Fork 5
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
111 remove public private switch #166
Changes from all commits
178e10a
f80b299
c129dc8
c8b3269
45a0f98
fb8429b
e7e7f36
37347ef
bb55c4b
65bc888
01c39f5
5a01f7a
6a23458
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import RoomUtils from "../utils/room-utils"; | ||
import Chainable = Cypress.Chainable; | ||
|
||
|
||
|
||
describe("Check room access settings", () => { | ||
const homeserverUrl = Cypress.env('E2E_TEST_USER_HOMESERVER_URL'); | ||
const email = Cypress.env('E2E_TEST_USER_EMAIL'); | ||
const password = Cypress.env('E2E_TEST_USER_PASSWORD'); | ||
const homeserverShortname = Cypress.env('E2E_TEST_USER_HOMESERVER_SHORT'); | ||
const today = new Date().toISOString().slice(0, 10).replace(/-/g, ''); | ||
|
||
beforeEach(() => { | ||
cy.loginUser(homeserverUrl, email, password); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. J'ai fait une version de cy.loginUser sans arguments, pour eviter d'avoir a specifier les defaults. Dans cette PR : #171 |
||
}); | ||
|
||
afterEach(() => { | ||
// todo delete room, otherwise the test user will end up with a million identical rooms after a while. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a PR to add this : #170 |
||
}); | ||
|
||
it("creates a public room and check access settings", () => { | ||
const roomName = "test/"+today+"/public_room_check_access_settings"; | ||
|
||
RoomUtils.createPublicRoom(roomName); | ||
|
||
openRoomAccessSettings(); | ||
|
||
//assert | ||
cy.get('#joinRule-invite-description').should('not.exist'); | ||
cy.get('#joinRule-restricted-description').should('not.exist'); | ||
cy.get('#joinRule-public-description').should('exist'); | ||
}); | ||
|
||
it("creates a private room and check access settings", () => { | ||
const roomName = "test/"+today+"/private_room_check_access_settings"; | ||
|
||
RoomUtils.createPrivateRoom(roomName); | ||
|
||
openRoomAccessSettings(); | ||
|
||
//assert | ||
cy.get('#joinRule-invite-description').should('exist'); | ||
cy.get('#joinRule-restricted-description').should('not.exist'); | ||
cy.get('#joinRule-public-description').should('not.exist'); | ||
}); | ||
|
||
it("creates a private room with external and check access settings", () => { | ||
const roomName = "test/"+today+"/private_room_check_access_settings"; | ||
|
||
RoomUtils.createPrivateRoomWithExternal(roomName); | ||
|
||
openRoomAccessSettings(); | ||
|
||
//assert | ||
cy.get('#joinRule-invite-description').should('exist'); | ||
cy.get('#joinRule-restricted-description').should('not.exist'); | ||
cy.get('#joinRule-public-description').should('not.exist'); | ||
}); | ||
}); | ||
|
||
|
||
function openRoomAccessSettings(){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on met ca dans les utils peut etre ? Chepa |
||
cy.get('.mx_RoomHeader_chevron').click(); | ||
cy.get('[aria-label="Paramètres"] > .mx_IconizedContextMenu_label').click(); | ||
cy.get('[data-testid="settings-tab-ROOM_SECURITY_TAB"] > .mx_TabbedView_tabLabel_text').click(); | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,51 @@ | ||||||
import Chainable = Cypress.Chainable; | ||||||
|
||||||
export default class RoomUtils { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alternatively, you could use tchap-web-v4/cypress/support/client.ts Lines 40 to 41 in ac8216a
But if it works, fine, let's move forward. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The convention to do this seems to be to add a file in /cypress/support and create |
||||||
|
||||||
static openCreateRoomDialog(): Chainable<JQuery<HTMLElement>> { | ||||||
const addRoomLabel = "Ajouter un salon"; | ||||||
const newRoomLabel = "Nouveau salon"; | ||||||
cy.get(`[aria-label="${addRoomLabel}"]`).click(); | ||||||
cy.get(`.mx_ContextualMenu [aria-label="${newRoomLabel}"]`).click(); | ||||||
return cy.get(".mx_Dialog"); | ||||||
} | ||||||
|
||||||
|
||||||
static createPrivateRoom(roomName: string) { | ||||||
RoomUtils.openCreateRoomDialog().within(() => { | ||||||
// Fill name | ||||||
const nameLabel = "Nom"; | ||||||
cy.get(`[label="${nameLabel}"]`).type(roomName); | ||||||
// Submit | ||||||
cy.startMeasuring("from-submit-to-room"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you start measuring here, but never stop, so I don't think it measures anything. (also I don't really know what this measuring does :) ) |
||||||
cy.get(".mx_Dialog_primary").click(); | ||||||
}); | ||||||
} | ||||||
|
||||||
static createPublicRoom(roomName: string) { | ||||||
RoomUtils.openCreateRoomDialog().within(() => { | ||||||
// Fill name | ||||||
const nameLabel = "Nom"; | ||||||
cy.get(`[label="${nameLabel}"]`).type(roomName); | ||||||
// Change room to public | ||||||
cy.get(".tc_TchapRoomTypeSelector_forum").click(); | ||||||
// Submit | ||||||
cy.startMeasuring("from-submit-to-room"); | ||||||
cy.get(".mx_Dialog_primary").click(); | ||||||
}); | ||||||
} | ||||||
|
||||||
static createPrivateRoomWithExternal(roomName: string) { | ||||||
RoomUtils.openCreateRoomDialog().within(() => { | ||||||
// Fill name | ||||||
const nameLabel = "Nom"; | ||||||
cy.get(`[label="${nameLabel}"]`).type(roomName); | ||||||
// Change room to public | ||||||
cy.get(".tc_TchapRoomTypeSelector_external").click(); | ||||||
// Submit | ||||||
cy.startMeasuring("from-submit-to-room"); | ||||||
cy.get(".mx_Dialog_primary").click(); | ||||||
}); | ||||||
} | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On veut ca ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oui sinon, a chaque changement, il relance les tests c'est tres penible