diff --git a/playwright.config.js b/playwright.config.js index 75f10e16c..922be7a57 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -14,7 +14,7 @@ module.exports = defineConfig({ globalSetup: './tests/playwright/globalSetup.js', testDir: './tests/playwright/tests', /* Run tests in files in parallel */ - fullyParallel: true, + fullyParallel: false, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ @@ -39,16 +39,6 @@ module.exports = defineConfig({ name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, - - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, - - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, ], }); diff --git a/tests/playwright/fixtures/embed_video.json b/tests/playwright/fixtures/embed_video.json index cd04abeb0..18345fe19 100644 --- a/tests/playwright/fixtures/embed_video.json +++ b/tests/playwright/fixtures/embed_video.json @@ -1,7 +1,27 @@ [ - "https://www.youtube.com/watch?v=qY8QmpdYFfc", - "https://www.youtube.com/watch?v=qY8Qmpdfc", - "https://www.youtube.com/live/RfnjNskapNg?feature=shared", - "https://www.youtube.com/embed/3pbyEGZjgH8?si=7kKze11tNJh554b1", - "https://vimeo.com/860144207" + { + "url": "https://www.youtube.com/watch?v=qY8QmpdYFfc", + "video_classname": ".ytp-title", + "valid": true + }, + { + "url": "https://www.youtube.com/watch?v=qY8Qmpdfc", + "video_classname": ".ytp-title", + "valid": false + }, + { + "url": "https://www.youtube.com/live/RfnjNskapNg?feature=shared", + "video_classname": ".ytp-title", + "valid": true + }, + { + "url": "https://www.youtube.com/embed/3pbyEGZjgH8?si=7kKze11tNJh554b1", + "video_classname": ".ytp-title", + "valid": true + }, + { + "url": "https://vimeo.com/860144207", + "video_title_class": ".vp-title", + "video_classname": true + } ] diff --git a/tests/playwright/fixtures/project.json b/tests/playwright/fixtures/project.json index 0152b8732..73d968cea 100644 --- a/tests/playwright/fixtures/project.json +++ b/tests/playwright/fixtures/project.json @@ -22,8 +22,8 @@ "room": "Zoom" }, { - "title": "BIC", - "room": "Hall" + "title": "Hasgeek House", + "room": "Second floor room" } ], "labels": [ diff --git a/tests/playwright/fixtures/user.json b/tests/playwright/fixtures/user.json index 0e78dbd0d..12e0a2315 100644 --- a/tests/playwright/fixtures/user.json +++ b/tests/playwright/fixtures/user.json @@ -2,27 +2,37 @@ "owner": { "username": "profile_cypress", "fullname": "profile-cypress", - "password": "profile-cypress123_St" + "password": "profile-cypress123_St", + "owns_profile": "fifthelephant", + "project": "summer-edition" }, "admin": { "username": "admin_user", "fullname": "admin-user", - "password": "admin-user129_Ftz" + "password": "admin-user129_Ftz", + "owns_profile": "rootconf", + "project": "autumn-edition" + }, + "editor": { + "username": "editor_cypress", + "fullname": "editor-cypress", + "password": "editor-cypress9_GH", + "owns_profile": "jsfoo", + "project": "monsoon-edition" }, "promoter": { "username": "promoter_user", "fullname": "promoter-user", - "password": "promoter-user34_qQE" + "password": "promoter-user34_qQE", + "owns_profile": "metarefresh", + "project": "winter-edition" }, "usher": { "username": "usher_cypress", "fullname": "usher-cypress", - "password": "usher-cypress566_YUt" - }, - "editor": { - "username": "editor_cypress", - "fullname": "editor-cypress", - "password": "editor-cypress9_GH" + "password": "usher-cypress566_YUt", + "owns_profile": "kilter", + "project": "spring-edition" }, "user": { "username": "member_user", diff --git a/tests/playwright/tests/add-crew-project.spec.js b/tests/playwright/tests/add-crew-project.spec.js deleted file mode 100644 index eabb73953..000000000 --- a/tests/playwright/tests/add-crew-project.spec.js +++ /dev/null @@ -1,26 +0,0 @@ -import { test, expect } from '@playwright/test'; - -const { LoginPage } = require('../page/login'); -const { ProjectCrewFormPage } = require('../page/project-crew-form'); -const { ProjectPage } = require('../page/create-project'); -const { owner, admin, promoter, usher, editor, hguser } = require('../fixtures/user.json'); - -test('Add crew to project', async ({ page }) => { - let randomProjectName = Math.random().toString(36).substring(2, 7); - let projectNameCapitalize = randomProjectName.charAt(0).toUpperCase() + randomProjectName.slice(1); - let loginPage; - loginPage = new LoginPage(page); - await loginPage.login(`/${owner.owns_profile}`, owner.username, owner.password); - let projectPage = new ProjectPage(page); - await projectPage.createNewProject(projectNameCapitalize); - - //Add crew - let crewForm = new ProjectCrewFormPage(page); - await page.getByTestId('crew').click(); - await crewForm.addMember(promoter.username, 'promoter'); - await crewForm.addMember(usher.username, 'usher'); - await crewForm.addMember(editor.username, 'editor'); - await crewForm.addMember(hguser.username, 'usher', false); - await crewForm.deleteMember(promoter.username); - -}); diff --git a/tests/playwright/tests/add-livestream.spec.js b/tests/playwright/tests/add-livestream.spec.js index a5f3e6701..9b51242b2 100644 --- a/tests/playwright/tests/add-livestream.spec.js +++ b/tests/playwright/tests/add-livestream.spec.js @@ -1,29 +1,28 @@ import { test, expect } from '@playwright/test'; const { LoginPage } = require('../page/login'); -const { ProjectPage } = require('../page/create-project'); -const project = require('../fixtures/project.json'); -const { admin, editor } = require('../fixtures/user.json'); +const { admin } = require('../fixtures/user.json'); const videos = require('../fixtures/embed_video.json'); test('Add livestream and verify embed youtube and vimeo urls', async ({ page }) => { - let projectPage = new ProjectPage(page); - let randomProjectName = await projectPage.addProject(admin, [{'username': editor.username, 'role': 'editor'}]); let loginPage = new LoginPage(page); - await loginPage.login(`/${admin.owns_profile}/${randomProjectName}`, editor.username, editor.password); + await loginPage.login(`/${admin.owns_profile}/${admin.project}`, admin.username, admin.password); - await page.getByTestId('add-livestream').click(); + await page.getByTestId('add-livestream-btn').click(); for(let video of videos) { - await page.locator('#livestream_urls').type(video); + await page.locator('#livestream_urls').type(video.url); await page.locator('#livestream_urls').press('Enter'); } await page.getByTestId('form-submit-btn').click(); for(let index=0; index { + let loginPage = new LoginPage(page); + await loginPage.login(`/${editor.owns_profile}/${editor.project}`, editor.username, editor.password); + + await page.getByTestId('site-editor-menu').locator('visible=true').click(); + await page.locator('.mui-dropdown__menu').locator('visible=true').waitFor(1000); + await Promise.all([ + page.waitForRequest(request => request.url().includes("/sponsor"), {timeout: 60000}), + await page.getByTestId('add-sponsor').click() + ]); + await page.locator('.select2-selection__arrow').waitFor(); + await page.locator('.select2-selection__arrow').click(); + await page.locator('.select2-search__field').waitFor(); + await page.locator('.select2-search__field').fill(admin.owns_profile); + await page.locator('.select2-results__option').waitFor(); + await page.locator('.select2-results__option').click(); + + await Promise.all([ + page.waitForResponse(response => response.url().includes("/sponsor") && response.status() === 200, {timeout: 60000}), + page.getByTestId('form-submit-btn').click() + ]); + await page.getByTestId('sponsor-link":has-text(`${admin.owns_profile}`)').isVisible(); + + await Promise.all([ + page.waitForRequest(request => request.url().includes("/edit"), {timeout: 60000}), + await page.getByTestId('edit-sponsor').locator('nth=1').click() + ]); + await page.locator('#is_promoted').click(); + await Promise.all([ + page.waitForResponse(response => response.url().includes("/edit") && response.status() === 200, {timeout: 60000}), + page.getByTestId('form-submit-btn').click() + ]); + await page.reload(); + await page.getByTestId('promoted').locator('nth=1').isVisible(); + + await Promise.all([ + page.waitForRequest(request => request.url().includes("/remove"), {timeout: 60000}), + await page.getByTestId('remove-sponsor').locator('nth=1').click() + ]); + await Promise.all([ + page.waitForResponse(response => response.url().includes("/remove") && response.status() === 200, {timeout: 60000}), + page.locator('input[value="Remove"]').click() + ]); + await page.reload(); + await expect.soft(page.getByTestId('sponsor-card')).toBeHidden(); +}); diff --git a/tests/playwright/tests/add-submission.spec.js b/tests/playwright/tests/add-submission.spec.js index bbcf9855b..32b8a2656 100644 --- a/tests/playwright/tests/add-submission.spec.js +++ b/tests/playwright/tests/add-submission.spec.js @@ -3,20 +3,18 @@ import { test, expect } from '@playwright/test'; const { LoginPage } = require('../page/login'); const { ProjectPage } = require('../page/create-project'); const project = require('../fixtures/project.json'); -const { user, usher } = require('../fixtures/user.json'); +const { usher, owner } = require('../fixtures/user.json'); const proposal = require('../fixtures/proposal.json'); let randomProjectName; -test('Submitting a proposal to a project', async ({ page }) => { - let projectPage = new ProjectPage(page); - randomProjectName = await projectPage.addProject(usher); +test('Submitting a proposal to a project and commenting on proposal', async ({ page }) => { let loginPage = new LoginPage(page); - await loginPage.login(`/${usher.owns_profile}/${randomProjectName}`, usher.username, usher.password); + await loginPage.login(`/${usher.owns_profile}/${usher.project}`, usher.username, usher.password); + let projectPage = new ProjectPage(page); await projectPage.addLabels(); - await projectPage.openCFP(); await loginPage.logout(); - await loginPage.login(`/${usher.owns_profile}/${randomProjectName}`, user.username, user.password); + await loginPage.login(`/${usher.owns_profile}/${usher.project}`, owner.username, owner.password); await page.getByTestId('propose-a-session').locator('visible=true').click(); await page.getByTestId('close-consent-modal').click(); await page.locator('#title').fill(proposal.title); @@ -55,7 +53,7 @@ test('Submitting a proposal to a project', async ({ page }) => { page.waitForRequest(request => request.url().includes("/new"), {timeout: 60000}), page.locator('.modal').locator('button[data-testid="form-submit-btn"]').locator('visible=true').click() ]); - await expect(page.locator('.toast-message')).toHaveCount(0, {timeout: 7000}); + await expect(page.locator('.toast-message')).toHaveCount(0, {timeout: 10000}); await page.locator('a.modal__close').locator('visible=true').click(); await page.getByTestId('form-submit-btn').waitFor(60000); await page.getByTestId('form-submit-btn').click(); @@ -63,7 +61,7 @@ test('Submitting a proposal to a project', async ({ page }) => { await page.locator('.user__box__userid user__box__userid badge', { hasText: 'Editor' }).isVisible(); await page.getByTestId('proposal-menu').locator('visible=true').click(); - await page.locator('.mui-dropdown__menu').locator('visible=true').waitFor(1000); + await page.locator('.mui-dropdown__menu').locator('visible=true').waitFor(3000); await page.getByTestId('delete').isVisible(); await page.getByTestId('edit-proposal-video').isVisible(); @@ -74,6 +72,6 @@ test('Submitting a proposal to a project', async ({ page }) => { page.getByTestId('new-form').getByTestId('submit-comment').click() ]); await expect(page.locator('.comment__body')).toContainText(proposal.proposer_note); - await expect(page.locator('.comment__header')).toContainText(user.username); + await expect(page.locator('.comment__header')).toContainText(owner.username); }); diff --git a/tests/playwright/tests/add-venue-project.spec.js b/tests/playwright/tests/add-venue-project.spec.js index 71c35b198..2d53c3006 100644 --- a/tests/playwright/tests/add-venue-project.spec.js +++ b/tests/playwright/tests/add-venue-project.spec.js @@ -1,16 +1,13 @@ import { test, expect } from '@playwright/test'; const { LoginPage } = require('../page/login'); -const { ProjectCrewFormPage } = require('../page/project-crew-form'); -const { ProjectPage } = require('../page/create-project'); const venues = require('../fixtures/venues.json'); -const { promoter, usher } = require('../fixtures/user.json'); +const { owner } = require('../fixtures/user.json'); test('Add venue to project', async ({ page }) => { - let projectPage = new ProjectPage(page); - let randomProjectName = await projectPage.addProject(promoter, [{'username': usher.username, 'role': 'editor'}]); - let loginPage = new LoginPage(page); - await loginPage.login(`/${promoter.owns_profile}/${randomProjectName}`, usher.username, usher.password); + let loginPage; + loginPage = new LoginPage(page); + await loginPage.login(`/${owner.owns_profile}/${owner.project}`, owner.username, owner.password); await page.getByTestId('project-menu').locator("visible=true").click(); await page.getByTestId('settings').locator("visible=true").waitFor(); diff --git a/tests/playwright/tests/create-project.spec.js b/tests/playwright/tests/create-project.spec.js index ef74097a6..3e33ac898 100644 --- a/tests/playwright/tests/create-project.spec.js +++ b/tests/playwright/tests/create-project.spec.js @@ -2,10 +2,11 @@ import { test, expect } from '@playwright/test'; const { LoginPage } = require('../page/login'); const { ProjectPage } = require('../page/create-project'); +const { ProjectCrewFormPage } = require('../page/project-crew-form'); const project = require('../fixtures/project.json'); -const { admin } = require('../fixtures/user.json'); +const { owner, admin, promoter, usher, editor, hguser } = require('../fixtures/user.json'); -test('To create project, edit, publish', async ({ page }) => { +test('To create project, edit, publish and add crew', async ({ page }) => { let randomProjectName = Math.random().toString(36).substring(2, 7); let projectNameCapitalize = randomProjectName.charAt(0).toUpperCase() + randomProjectName.slice(1); let loginPage; @@ -29,5 +30,12 @@ test('To create project, edit, publish', async ({ page }) => { //Publish project await projectPage.publishProject(); + let crewForm = new ProjectCrewFormPage(page); + await page.getByTestId('crew').click(); + await crewForm.addMember(promoter.username, 'promoter'); + await crewForm.addMember(usher.username, 'usher'); + await crewForm.addMember(editor.username, 'editor'); + await crewForm.addMember(hguser.username, 'usher', false); + await crewForm.deleteMember(promoter.username); }); diff --git a/tests/playwright/tests/open-cfp.spec.js b/tests/playwright/tests/open-cfp.spec.js index bf451c800..89cad7a2c 100644 --- a/tests/playwright/tests/open-cfp.spec.js +++ b/tests/playwright/tests/open-cfp.spec.js @@ -2,19 +2,16 @@ import { test, expect } from '@playwright/test'; const { LoginPage } = require('../page/login'); const { ProjectPage } = require('../page/create-project'); -const profile = require('../fixtures/profile.json'); const project = require('../fixtures/project.json'); -const { promoter, editor, user } = require('../fixtures/user.json'); +const { promoter, user } = require('../fixtures/user.json'); const cfp = require('../fixtures/cfp.json'); const labels = require('../fixtures/labels.json'); const dayjs = require('dayjs'); -test('Open call for proposal of the project and add schedule', async ({ page }) => { - let projectPage = new ProjectPage(page); - let randomProjectName = await projectPage.addProject(promoter, [{'username': editor.username, 'role': 'editor'}]); +test('Add schedule to a project (open cfp, add labels, sort labels, add session, publish schedule)', async ({ page }) => { let loginPage = new LoginPage(page); - await loginPage.login(`/${promoter.owns_profile}/${randomProjectName}`, editor.username, editor.password); - await projectPage.addVenue(); + let projectPage = new ProjectPage(page); + await loginPage.login(`/${promoter.owns_profile}/${promoter.project}`, promoter.username, promoter.password); await page.getByTestId('submissions').click(); await page.getByTestId('add-cfp').click(); await page.locator('#field-instructions .cm-editor .cm-line').fill(cfp.instructions); @@ -81,7 +78,7 @@ test('Open call for proposal of the project and add schedule', async ({ page }) await page.locator('#title').fill(project.session_title); await page.locator('select#venue_room_id').click(); await page.getByText(`${project.venues[0].title} – ${project.venues[0].room}`).locator('visible=true').click(); - await page.locator('#speaker').fill(editor.username); + await page.locator('#speaker').fill(promoter.username); await page.locator('#is_break').click(); await Promise.all([ page.waitForRequest(request => request.url().includes("/new"), {timeout: 60000}), @@ -138,7 +135,7 @@ test('Open call for proposal of the project and add schedule', async ({ page }) ]); await page.locator('#session-modal').isVisible(); await expect(page.getByTestId('title')).toContainText(project.proposal_title); - await expect(page.getByTestId('speaker')).toContainText(editor.fullname); + await expect(page.getByTestId('speaker')).toContainText(promoter.fullname); await page.getByTestId('time').isVisible(); await expect(page.getByTestId('room')).toContainText(`${project.venues[1].room}, ${project.venues[1].title}`); await page.getByTestId('session-video').locator('iframe').isVisible(); diff --git a/tests/playwright/tests/post-update.spec.js b/tests/playwright/tests/post-update.spec.js new file mode 100644 index 000000000..7f278efa2 --- /dev/null +++ b/tests/playwright/tests/post-update.spec.js @@ -0,0 +1,43 @@ +import { test, expect } from '@playwright/test'; + +const { LoginPage } = require('../page/login'); +const { usher, admin } = require('../fixtures/user.json'); +const project = require('../fixtures/project.json'); + +test('Add update to project', async ({ page }) => { + let loginPage = new LoginPage(page); + await loginPage.login(`/${usher.owns_profile}/${usher.project}`, usher.username, usher.password); + + await page.getByTestId('updates').click(); + await page.getByTestId('add-update').click(); + await page.locator('#title').fill(project.update_title); + await page.locator('#field-body .cm-editor .cm-line').fill(project.update_body); + await page.locator('#is_pinned').click(); + await page.getByTestId('form-submit-btn').click(); + await page.getByTestId('form-submit-btn').click(); + await page.getByTestId('add-update').click(); + await page.locator('#title').fill(project.restricted_update_title); + await page.locator('#field-body .cm-editor .cm-line').fill(project.restricted_update_body); + await page.locator('#is_restricted').click(); + await page.getByTestId('form-submit-btn').click(); + await page.getByTestId('form-submit-btn').click(); + await loginPage.logout(); + + await loginPage.login(`/${usher.owns_profile}/${usher.project}`, user.username, user.password); + await expect(page.locator('.pinned__update__heading')).toContainText(project.update_title); + await page.getByTestId('updates').click(); + await expect(page.locator('.update').locator('nth=1').locator('h3')).toContainText(project.restricted_update_title); + await page.getByTestId('my-updates').locator('visible=true').click(); + await Promise.all([ + page.waitForRequest(request => request.url().includes("/updates"), {timeout: 60000}), + ]); + await expect(page.locator('.update').getByTestId('notification-box').locator('h2')).contains(project.update_title); + await loginPage.logout(); + + await loginPage.login(`/${usher.owns_profile}/${usher.project}`, newuser.username, newuser.password); + await page.getByTestId('updates').click(); + await expect(page.locator('.pinned__update__heading')).toContainText(project.update_title); + await page.getByTestId('updates').click(); + await expect(page.locator('.update').locator('nth=1')).toBeHidden(); + +}); diff --git a/tests/playwright/tests/rsvp-checkin.spec.js b/tests/playwright/tests/rsvp-checkin.spec.js index 832d2b0da..5817bb75f 100644 --- a/tests/playwright/tests/rsvp-checkin.spec.js +++ b/tests/playwright/tests/rsvp-checkin.spec.js @@ -1,31 +1,19 @@ import { test, expect } from '@playwright/test'; const { LoginPage } = require('../page/login'); -const { ProjectPage } = require('../page/create-project'); -const profile = require('../fixtures/profile.json'); -const project = require('../fixtures/project.json'); -const { admin, promoter, usher, user } = require('../fixtures/user.json'); +const { admin, user } = require('../fixtures/user.json'); const events = require('../fixtures/ticket_events.json'); const ticket_participants = require('../fixtures/ticket_participants.json'); const dayjs = require('dayjs'); test('Open rsvp, for all and members only', async ({ page }) => { - let projectPage = new ProjectPage(page); - let randomProjectName = await projectPage.addProject(admin, [{'username': promoter.username, 'role': 'promoter'}, {'username': usher.username, 'role': 'usher'}]); let loginPage = new LoginPage(page); - await loginPage.login(`/${admin.owns_profile}/${randomProjectName}`, promoter.username, promoter.password); + await loginPage.login(`/${admin.owns_profile}/${admin.project}`, admin.username, admin.password); await page.getByTestId('project-menu').locator('visible=true').click(); await page.getByTestId('settings').locator('visible=true').click(); await page.getByTestId('setup-ticket-events').click(); - for (let event of events) { - await page.getByTestId('new-ticket-event').click(); - await page.locator('#title').fill(event.title); - await page.locator('#badge_template').fill(event.badge_template); - await page.getByTestId('form-submit-btn').click(); - } - await page.getByTestId('new-ticket-client').click(); await page.locator('#name').fill(process.env.BOXOFFICE_CLIENT_ID); await page.locator('#clientid').fill(process.env.BOXOFFICE_CLIENT_ID); @@ -35,7 +23,14 @@ test('Open rsvp, for all and members only', async ({ page }) => { await page.getByTestId('form-submit-btn').click(); await page.getByTestId('sync-tickets').click(); - await page.waitForTimeout(12000); + + for (let event of events) { + await page.getByTestId('new-ticket-event').click(); + await page.locator('#title').fill(event.title); + await page.locator('#badge_template').fill(event.badge_template); + await page.getByTestId('form-submit-btn').click(); + } + await page.getByTestId('sync-tickets').click(); for (let event of events) { @@ -44,8 +39,6 @@ test('Open rsvp, for all and members only', async ({ page }) => { await page.getByTestId('form-submit-btn').click(); } - await page.getByTestId('sync-tickets').click(); - await page.waitForTimeout(12000); await page.getByTestId('sync-tickets').click(); for (let participant of ticket_participants) { @@ -70,16 +63,6 @@ test('Open rsvp, for all and members only', async ({ page }) => { await page.getByTestId('back-to-setup').click(); await page.getByTestId('project-page').click(); - await page.getByTestId('project-menu').locator('visible=true').click(); - await page.getByTestId('edit').locator('visible=true').click(); - let eventStartDate = dayjs().add(1, 'days').format('YYYY-MM-DDTHH:MM'); - let eventEndDate = dayjs().add(10, 'days').format('YYYY-MM-DDTHH:MM'); - await page.locator('#start_at').fill(eventStartDate); - await page.locator('#end_at').fill(eventEndDate); - await page.getByTestId('form-submit-btn').click(); - await page.getByTestId('project-menu').locator('visible=true').click(); - await page.getByTestId('settings').locator('visible=true').click(); - await page.getByTestId('publish').click(); await page.getByTestId('project-menu').locator('visible=true').click(); await page.getByTestId('settings').locator('visible=true').click(); await page.getByTestId('add-tickets').click(); @@ -89,7 +72,7 @@ test('Open rsvp, for all and members only', async ({ page }) => { await page.getByTestId('rsvp-only-for-members').isVisible(); await loginPage.logout(); - await loginPage.login(`/${admin.owns_profile}/${randomProjectName}`, user.username, user.password); + await loginPage.login(`/${admin.owns_profile}/${admin.project}`, user.username, user.password); await page.getByTestId('project-member').isVisible(); await page.getByTestId('member-rsvp').click(); await page.locator('#rsvp-form').waitFor(60000); diff --git a/tests/test_fixture_initdb.py b/tests/test_fixture_initdb.py index 51270c13d..92f7c1fb2 100644 --- a/tests/test_fixture_initdb.py +++ b/tests/test_fixture_initdb.py @@ -13,7 +13,13 @@ SiteMembership, User, db, + Project, + Venue, + VenueRoom ) +from coaster.utils import utcnow +from datetime import datetime, timedelta +from pytz import utc def init_models(): @@ -21,113 +27,165 @@ def init_models(): db.drop_all() db.create_all() - user_admin = User(username='admin_user', fullname='admin-user') - user_admin.password = 'admin-user129_Ftz' # nosec - user_admin_email = AccountEmail( - email='adminuser@example.com', account=user_admin - ) - db.session.add(user_admin.add_phone('+918123456789', primary=True)) - - user = User(username='member_user', fullname='member-user') - user.password = 'member-user341_Wer' # nosec - user_email = AccountEmail(email='memberuser@example.com', account=user) - db.session.add(user.add_phone('+12015550123', primary=True)) - - profile_owner = User( + owner = User( username='profile_cypress', fullname='profile-cypress', ) - profile_owner.password = 'profile-cypress123_St' # nosec - profile_owner_email = AccountEmail( - email='profileowner@example.com', account=profile_owner - ) - db.session.add(profile_owner.add_phone('+15062345678', primary=True)) - - promoter = User(username='promoter_user', fullname='promoter-user') - promoter.password = 'promoter-user34_qQE' # nosec - promoter_email = AccountEmail(email='promoter@example.com', account=promoter) - - usher = User(username='usher_cypress', fullname='usher-cypress') - usher.password = 'usher-cypress566_YUt' # nosec - usher_email = AccountEmail(email='usher@example.com', account=usher) - - editor = User(username='editor_cypress', fullname='editor-cypress') - editor.password = 'editor-cypress9_GH' # nosec - editor_email = AccountEmail(email='editor@example.com', account=editor) - db.session.add(editor.add_phone('+447400123456', primary=True)) - - user2 = User(username='hg_user', fullname='hg-user') - user2.password = 'hg-user5_HE' # nosec - - user3 = User(username='new_user', fullname='new-user') - user3.password = 'new-user11_EveryOne' # nosec - - sm = SiteMembership( - member=profile_owner, is_site_editor=True, granted_by=profile_owner - ) - - org = Organization( - name='testprofile', title='testprofile', owner=profile_owner + owner.password = 'profile-cypress123_St' # nosec + owner_email = AccountEmail( + email='profileowner@example.com', account=owner ) - org.is_verified = True - org.make_profile_public() + db.session.add(owner.add_phone('+15062345678', primary=True)) org1 = Organization( - name='fifthelephant', title='Fifth elephant', owner=profile_owner + name='fifthelephant', title='Fifth elephant', owner=owner ) org1.is_verified = True org1.make_profile_public() + project1 = Project( + name='summer-edition', title='Summer Edition', created_by=owner, + account=org1, location='Online', tagline='Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + description='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book' + ) + + admin = User(username='admin_user', fullname='admin-user') + admin.password = 'admin-user129_Ftz' # nosec + admin_email = AccountEmail( + email='adminuser@example.com', account=admin + ) + db.session.add(admin.add_phone('+918123456789', primary=True)) org2 = Organization( - name='rootconf', title='Rootconf', owner=user_admin + name='rootconf', title='Rootconf', owner=admin ) org2.is_verified = True org2.make_profile_public() + project2 = Project( + name='autumn-edition', title='Autumn Edition', created_by=admin, + account=org2, location='Online', tagline='Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + description='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book' + ) + + editor = User(username='editor_cypress', fullname='editor-cypress') + editor.password = 'editor-cypress9_GH' # nosec + editor_email = AccountEmail(email='editor@example.com', account=editor) + db.session.add(editor.add_phone('+447400123456', primary=True)) + org3 = Organization( name='jsfoo', title='JSFoo', owner=editor ) org3.is_verified = True org3.make_profile_public() + project3 = Project( + name='monsoon-edition', title='Monsoon Edition', created_by=editor, + account=org3, location='Online', tagline='Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + description='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book' + ) + + promoter = User(username='promoter_user', fullname='promoter-user') + promoter.password = 'promoter-user34_qQE' # nosec + promoter_email = AccountEmail(email='promoter@example.com', account=promoter) + db.session.add(promoter.add_phone('+919845012345', primary=True)) + org4 = Organization( name='metarefresh', title='Metarefresh', owner=promoter ) org4.is_verified = True org4.make_profile_public() + project4 = Project( + name='winter-edition', title='Winter Edition', created_by=promoter, + account=org4, location='Online', tagline='Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + description='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book' + ) + + usher = User(username='usher_cypress', fullname='usher-cypress') + usher.password = 'usher-cypress566_YUt' # nosec + usher_email = AccountEmail(email='usher@example.com', account=usher) + db.session.add(usher.add_phone('+918123456788', primary=True)) + org5 = Organization( name='kilter', title='Kilter', owner=usher ) org5.is_verified = True org5.make_profile_public() + project5 = Project( + name='spring-edition', title='Spring Edition', created_by=usher, + account=org5, location='Online', tagline='Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + description='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book' + ) + + user = User(username='member_user', fullname='member-user') + user.password = 'member-user341_Wer' # nosec + user_email = AccountEmail(email='memberuser@example.com', account=user) + db.session.add(user.add_phone('+12015550123', primary=True)) + + hguser = User(username='hg_user', fullname='hg-user') + hguser.password = 'hg-user5_HE' # nosec + + newuser = User(username='new_user', fullname='new-user') + newuser.password = 'new-user11_EveryOne' # nosec + + sm = SiteMembership( + member=owner, is_site_editor=True, granted_by=owner + ) + db.session.add_all( [ - user_admin, - user_admin_email, - user, - user_email, - profile_owner, - profile_owner_email, + owner, + owner_email, + admin, + admin_email, + editor, + editor_email, promoter, promoter_email, usher, usher_email, - editor, - editor_email, - user2, - user3, + user, + user_email, + hguser, + newuser, sm, - org, org1, org2, org3, org4, - org5 + org5, + project1, + project2, + project3, + project4, + project5 ] ) db.session.commit() + project1.publish() + project2.publish() + project3.publish() + project4.publish() + venue1 = Venue(name='hasgeek', title='Hasgeek House', description='Hasgeek House second floor', project=project4, seq=1) + venue2 = Venue(name='online', title='Online', description='Zoom', project=project4, seq=2) + room1 = VenueRoom(name='second-floor-room', title='Second floor room', description='Hasgeek House second floor', bgcolor='F7B89E', venue=venue1, seq=1) + room2 = VenueRoom(name='zoom', title='Zoom', description='Zoom', bgcolor='6075B1', venue=venue2, seq=2) + project5.publish() + project5.cfp_start_at = datetime.now(utc) + project5.cfp_end_at = datetime.now(utc) + timedelta(days=10) + project5.instructions = 'If you are interested in speaking at The Fifth Elephant.Submit a description of your talk, explaining the problem that your talk covers, and one concrete takeaway for audience. Talks have to give at least one practical insight to the audience' + project5.open_cfp() + db.session.add_all( + [ + venue1, + venue2, + room1, + room2 + ] + ) + db.session.commit() + if __name__ == '__main__':