@@ -1,64 +0,0 @@ | |||||
import { Selector } from 'testcafe'; | |||||
fixture `Setup Wizard` | |||||
.page `http://localhost:8000/login`; | |||||
test('Setup Wizard Test', async t => { | |||||
const wizard_heading = Selector(() => { | |||||
return $('p.lead:visible')[0]; | |||||
}) | |||||
const lang = Selector("select[data-fieldname='language']") | |||||
const next_btn = Selector("a.next-btn") | |||||
const country = Selector("select[data-fieldname='country']") | |||||
const timezone = Selector("select[data-fieldname='timezone']") | |||||
const currency = Selector("select[data-fieldname='currency']") | |||||
const full_name = Selector("input[data-fieldname='full_name']") | |||||
const email = Selector("input[data-fieldname='email']") | |||||
const password = Selector("input[data-fieldname='password']") | |||||
const upload_input = Selector("input.input-upload-file") | |||||
const upload_btn = Selector("button").withText("Upload") | |||||
const modal_close_btn = Selector("div.modal.in button.btn-modal-close") | |||||
const missing_image_div = Selector("div.missing-image") | |||||
const complete_setup = Selector("a.complete-btn").nth(2) | |||||
const setup_complete_div = Selector("p").withText("Setup Complete") | |||||
await t | |||||
.typeText('#login_email', 'Administrator') | |||||
.typeText('#login_password', 'admin') | |||||
.click('.btn-login') | |||||
.navigateTo('/desk#setup-wizard') | |||||
// Step 0 | |||||
.expect(wizard_heading.innerText).eql("Welcome") | |||||
.click(lang) | |||||
.click("option[value='English (United States)']") | |||||
.expect(lang.value).eql("English (United States)") | |||||
.click(next_btn) | |||||
// Step 1 | |||||
.expect(wizard_heading.innerText).eql("Region") | |||||
.click(country) | |||||
.click("option[value='India']") | |||||
.expect(country.value).eql("India") | |||||
.expect(timezone.value).eql("Asia/Kolkata") | |||||
.expect(currency.value).eql("INR") | |||||
.click(next_btn.nth(1)) | |||||
// Step 2 | |||||
.expect(wizard_heading.innerText).eql("The First User: You") | |||||
.typeText(full_name, "Jane Doe") | |||||
.expect(full_name.value).eql("Jane Doe") | |||||
.typeText(email, "jane_doe@example.com") | |||||
.expect(email.value).eql("jane_doe@example.com") | |||||
.typeText(password, "password") | |||||
.expect(password.value).eql("password") | |||||
.click("button[data-fieldname='attach_user']") | |||||
.setFilesToUpload(upload_input, './uploads/user_picture.svg') | |||||
.click(upload_btn) | |||||
.click(modal_close_btn) | |||||
.expect(missing_image_div.visible).notOk() | |||||
.click(complete_setup) | |||||
.expect(setup_complete_div.visible).ok() | |||||
}); |
@@ -1,56 +0,0 @@ | |||||
import { Selector } from 'testcafe'; | |||||
function today(){ | |||||
var today = new Date(); | |||||
var dd = today.getDate(); | |||||
var mm = today.getMonth()+1; //January is 0! | |||||
var yyyy = today.getFullYear(); | |||||
var today = dd+'-'+mm+'-'+yyyy; | |||||
return today; | |||||
} | |||||
fixture `ToDo Tests` | |||||
.page `http://localhost:8000/login`; | |||||
test('ToDo - Insert, List and Delete', async t => { | |||||
const new_btn = Selector("button.btn-primary").withText("New") | |||||
const priority = Selector("select[data-fieldname='priority']") | |||||
const desc = Selector("[data-fieldname='description'] div.note-editable") | |||||
const save_btn = Selector("button.primary-action").withText("Save") | |||||
const mytodo = Selector("a.list-id").withText("TestCafe.") | |||||
const menu_btn = Selector("[data-page-route='Form/ToDo'] .menu-btn-group button") | |||||
const yes_btn = Selector("button.btn-primary", {visibilityCheck: true}).withText("Yes") | |||||
const refresh_btn = Selector("button").withText("Refresh") | |||||
const delete_btn = Selector("a").withText("Delete") | |||||
await t | |||||
.typeText('#login_email', 'jane_doe@example.com') | |||||
.typeText('#login_password', 'password') | |||||
.click('.btn-login') | |||||
.navigateTo('/desk#List/ToDo') | |||||
// ToDo Insert | |||||
.click(new_btn) | |||||
.click("a.edit-full") | |||||
.typeText("input[data-fieldname='date']", today()) | |||||
.click(priority) | |||||
.click("option[value='High']") | |||||
.expect(priority.value).eql("High") | |||||
.typeText(desc, "Finish writing ToDo tests in TestCafe.") | |||||
.click(save_btn) | |||||
.wait(200) | |||||
// Check List View | |||||
.click("a[href='#List/ToDo']") | |||||
.expect(mytodo.visible).ok() | |||||
//ToDo Delete | |||||
.click(mytodo) | |||||
.click(menu_btn) | |||||
.click(delete_btn) | |||||
.click(yes_btn) | |||||
// Check ListView Again | |||||
.click(refresh_btn) | |||||
.expect(mytodo.exists).notOk() | |||||
}); |
@@ -1,22 +0,0 @@ | |||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||||
<!-- Written by Treer (gitlab.com/Treer) --> | |||||
<svg | |||||
version="1.1" | |||||
xmlns="http://www.w3.org/2000/svg" | |||||
xmlns:xlink="http://www.w3.org/1999/xlink" | |||||
width="600" | |||||
height="600" | |||||
fill="white"> | |||||
<title>Abstract user icon</title> | |||||
<defs> | |||||
<clipPath id="circular-border"> | |||||
<circle cx="300" cy="300" r="250" /> | |||||
</clipPath> | |||||
</defs> | |||||
<circle cx="300" cy="300" r="280" fill="black" /> | |||||
<circle cx="300" cy="230" r="100" /> | |||||
<circle cx="300" cy="550" r="190" clip-path="url(#circular-border)" /> | |||||
</svg> |