Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'v*'

env:
DOCKER_REPO_NAME: kaw393939/mywebclass
DOCKER_REPO_NAME: tawanaarthur/project1

jobs:
build:
Expand Down
16 changes: 16 additions & 0 deletions Team_Productivity_Log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Team Productivity Log

This table tracks the progress of tasks in our project, including the issue title, story points, issue link, status, assigned to and assigned on, completed on, category, and status notes.

| Issue title | Story points | Issue link | Status | Assigned to, Assigned on | Completed on | Category | Status notes |
|------------------------------------------|--------------|-----------------------------------------------------------------------|-------------|--------------------------|--------------|---------------|----------------------------------------------------------|
| Team Productivity Log | 1 | [Link](https://github.com/tawana0518/mywebclass-simulation/issues/11) | Completed | Rajiv, 2022-03-16 | 2022-03-16 | Documentation | Completed documenting Marked Down File |
| Internationalization Research | 2 | [Link](https://github.com/tawana0518/mywebclass-simulation/issues/3) | In Progress | Rajiv, 2022-03-15 | - | Research | Drafted initial version on Internationalization Research |
| Home Page | 5 | [Link](https://github.com/tawana0518/mywebclass-simulation/issues/2) | In Progress | Rajiv, 2022-03-14 | - | Enhancement | Initial analysis in progress |
| Front End Responsive Frameworks Research | 3 | [Link](https://github.com/tawana0518/mywebclass-simulation/issues/13) | To do | Rajiv, 2022-03-16 | - | Research | |
| Accessibility Research | 2 | [Link](https://github.com/tawana0518/mywebclass-simulation/issues/4) | Completed | Berta, 2022-03-14 | 2022-03-15 | Research | Drafted initial version on Accessibility Research |
| Legal compliance Research | 2 | [Link](https://github.com/tawana0518/mywebclass-simulation/issues/6) | Completed | Berta, 2022-03-14 | 2022-03-15 | Research | Drafted initial version for legal compliance and privacy policy Research |
| SEO research | 2 | [Link](https://github.com/tawana0518/mywebclass-simulation/issues/5) | Completed | Tawana, 2022-03-14 | 2022-03-15 | Research | Researched and draft SEO Research - found in Wiki |
|Playwright Tests Research | 3 | [Link](https://github.com/tawana0518/mywebclass-simulation/issues/12) | In progress | Tawana, 2022-03-17 | - | Research | Continuing research on playwright testing and lighthouse reports |
To add a new task to the table, a team member should create an issue on GitHub and add the link to the table with the relevant details. By keeping track of our progress in this table, we can ensure that tasks are assigned and completed efficiently and effectively.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.8"
services:
master_branch:
development_branch:
image: kaw393939/mywebclass:development
image: tawanaarthur/project1:development
container_name: development_branch
pull_policy: always
restart: always
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mywebclass.org",
"version": "0.1.0",
"version": "0.1.1",
"description": "Help for students and teachers learning advanced technologies.",
"main": "src/index.js",
"directories": {
Expand All @@ -25,14 +25,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/NJIT-WIS/mywebclass.git"
"url": "git+https://github.com/tawana0518/mywebclass-simulation.git"
},
"author": "Keith Williams @ NJIT.EDU",
"license": "MIT",
"bugs": {
"url": "https://github.com/NJIT-WIS/mywebclass/issues"
"url": "https://github.com/tawana0518/mywebclass-simulation/issues"
},
"homepage": "https://github.com/NJIT-WIS/mywebclass#readme",
"homepage": "https://github.com/tawana0518/mywebclass-simulation#readme",
"devDependencies": {
"@playwright/test": "^1.31.1",
"autoprefixer": "^10.4.13",
Expand Down
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!DOCTYPE html>
<!--@Rajiv 19th March - Updated the lang attribute from "EN" to "{lang}" in the html tag in your index.html file to support dynamic language changes: -->
<html lang="EN">

<head>
Expand Down
14 changes: 14 additions & 0 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import allPage from './allPages'
import contentPage from './contentPage'

document.addEventListener('DOMContentLoaded', () => {
// @Rajiv 19th March - Call the setLanguage() function when the DOM content is loaded
setLanguage()
allPage.initialize()
contentPage.initialize()
})
Expand Down Expand Up @@ -109,3 +111,15 @@ document.addEventListener('DOMContentLoaded', () => {
createPrivacyModal()
loadGoogleAnalytics()
})

// @Rajiv 19th March - Create a JavaScript function in the main.js file to set the language attribute dynamically based on the user's language preference:
function setLanguage () {
// Get the user's preferred language
const userLang = navigator.language || navigator.userLanguage

// Check if the user's language is supported (in this example, we're checking for English)
const supportedLang = userLang.substring(0, 2).toLowerCase() === 'en' ? 'en' : 'en'

// Set the 'lang' attribute of the 'html' tag to the supported language
document.documentElement.setAttribute('lang', supportedLang)
}
2 changes: 2 additions & 0 deletions src/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ body.banner-offset {
}
}




26 changes: 26 additions & 0 deletions tests/mywebclass_internationalization.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { test, expect } from '@playwright/test'

test.describe('MyWebClass.org internationalization', () => {
let page

test.beforeEach(async ({ browser }) => {
page = await browser.newPage()
await page.goto('http://localhost:3000')
})

test.afterEach(async () => {
await page.close()
})

test('should display the site in "en" when the "Accept-Language" header is set to "en"', async () => {
// Set the Accept-Language header and navigate to the website
await page.setExtraHTTPHeaders({ 'Accept-Language': 'en' })
await page.goto('http://localhost:3000')

// Check if the lang attribute of the HTML tag is set to "en"
const langAttribute = await page.getAttribute('html', 'lang')
expect(langAttribute).toBe('en', 'The lang attribute of the HTML tag is not set to "en".')

// Perform any additional checks for the "en" language version of the website here, e.g., checking specific text or elements
})
})
21 changes: 21 additions & 0 deletions tests/mywebclass_privacy.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* global localStorage */
import { test, expect } from '@playwright/test'

test('test', async ({ page }) => {
await page.goto('http://localhost:3000/')
await page.getByRole('button', { name: 'Agree', exact: true }).click()

// Retrieve the privacyPolicyAgreed item from local storage
const privacyPolicyAgreed = await page.evaluate(() => {
return localStorage.getItem('privacyPolicyAgreed')
})

// Check if privacyPolicyAgreed is set in local storage
expect(privacyPolicyAgreed).toBeTruthy()

// Click the "Content Template" link
await page.getByRole('link', { name: 'Content Template' }).click()

// Click the "Section 3" link
await page.getByRole('link', { name: 'Section 3' }).click()
})
27 changes: 27 additions & 0 deletions tests/mywebclass_seo.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { test, expect } from '@playwright/test'

test.describe('MyWebClass.org tests', () => {
test('SEO tests', async ({ page }) => {
await page.goto('http://localhost:3000/')
// Test for keyword research
const keywords = ['MyWebClass.org']
const pageContent = await page.textContent('body')
const hasKeywords = keywords.every(keyword => pageContent.includes(keyword))
expect(hasKeywords).toBeTruthy()
// Test for meta tags
const pageTitle = await page.title()
const pageMetaDescription = await page.$eval('meta[name="description"]', el => el.content)
const pageMetaKeywords = await page.$eval('meta[name="keywords"]', el => el.content)
const hasMetaTags = Boolean(pageTitle && pageMetaDescription && pageMetaKeywords)
expect(hasMetaTags).toBeTruthy()
// Test for URL structure
const pageUrl = page.url()
const pageUrlPathname = new URL(pageUrl).pathname
const hasProperUrlStructure = Boolean(pageUrl && !pageUrl.includes('%20') && pageUrlPathname === '/')
expect(hasProperUrlStructure).toBeTruthy()
// Test for fast load times
const pageLoadTime = await page.evaluate(() => window.performance.timing.domContentLoadedEventEnd - window.performance.timing.navigationStart)
const isFastLoading = pageLoadTime <= 3000
expect(isFastLoading).toBeTruthy()
})
})