Skip to content

Instantly share code, notes, and snippets.

@shwetaneelsharma
Created September 8, 2020 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shwetaneelsharma/e3664ca6e720bf1dbf1c52341327e970 to your computer and use it in GitHub Desktop.
Save shwetaneelsharma/e3664ca6e720bf1dbf1c52341327e970 to your computer and use it in GitHub Desktop.
Create Topic CT via UI
import {
getfirstTopicTitle, getfirstTopicType, getTopicTitle, getTopicType, getSummaryTextFormat, getSourceBtnLocator, getCKEditorBodyLocator, getTopicDurationLocator, getTopicAudienceLocator, getTopicPublicityLocator, getTopicRecordingLinkURI,
clickBtnInsideCKEditorSummary, getSubmitButtonLocator, selectAuthor
} from '../page-objects/create_topic'
import {
CONTENT_URL, TOPIC_TYPE, TOPIC_BODY, TOPIC_TITLE, TOPIC_RECORDING_LINK, FORMAT_TYPE, TOPIC_DURATION, TOPIC_AUDIENCE, CSS_COLOR_PROPERTY, TOPIC_PUBLICITY_DEFAULT_CSS, SAVE_BTN_TEXT, CREATED_TOPICS_URL
} from '../fixtures/topic_testdata'
describe('Verify Topic End to End flow', function () {
before(function () {
cy.createUser(Cypress.env('cyAdminUser'), Cypress.env('cyAdminPassword'), Cypress.env('cyAdminRole'));
});
it('Create and verify a topic using ui', function () {
cy.login(Cypress.env('cyAdminUser'));
cy.visit(CONTENT_URL);
getTopicTitle().type(TOPIC_TITLE);
cy.selectDropDown(getTopicType, TOPIC_TYPE);
cy.checkDefaultTextFormat(getSummaryTextFormat, FORMAT_TYPE);
clickBtnInsideCKEditorSummary(getSourceBtnLocator);
cy.setValueByJQuery(getCKEditorBodyLocator, TOPIC_BODY);
selectAuthor(Cypress.env('cyPresenter'));
cy.typeTextInput(getTopicDurationLocator, TOPIC_DURATION);
cy.selectDropDown(getTopicAudienceLocator, TOPIC_AUDIENCE);
getTopicPublicityLocator().should('have.css', CSS_COLOR_PROPERTY, TOPIC_PUBLICITY_DEFAULT_CSS);
cy.setValueByJQuery(getTopicRecordingLinkURI, TOPIC_RECORDING_LINK);
cy.clickByLocatorAndPartialText(getSubmitButtonLocator, SAVE_BTN_TEXT);
cy.visit(CREATED_TOPICS_URL);
getfirstTopicTitle().should('have.text', TOPIC_TITLE);
getfirstTopicType().should('have.text', TOPIC_TYPE);
cy.logout();
});
after(function () {
cy.deleteUser(Cypress.env('cyAdminUser'));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment