repo_id
stringclasses 208
values | file_path
stringlengths 31
190
| content
stringlengths 1
2.65M
| __index_level_0__
int64 0
0
|
---|---|---|---|
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/AccModels.js
|
import React, { useEffect, useState } from "react";
import { Container, Typography, Box, Button } from "@mui/material";
import {
fetchACCModels,
createACCModel,
updateACCModel,
deleteACCModel,
} from "../services/accModelService";
import AccModelForm from "../components/accModels/AccModelForm";
import AccModelList from "../components/accModels/AccModelList";
import ConfirmDialog from "../components/accModels/ConfirmDialog";
/**
* A React component for displaying a list of ACC models.
*
* This component fetches a list of ACC models from the server when it mounts,
* and displays them in a list. It also provides a button to create a new ACC
* model, and a form to edit an existing ACC model. The form is opened by
* clicking on an ACC model in the list. The form is also used to delete an
* ACC model.
*
* @returns {JSX.Element} The rendered React component.
*/
const AccModels = () => {
const [models, setModels] = useState([]);
const [isModalOpen, setIsModalOpen] = useState(false);
const [isDialogOpen, setIsDialogOpen] = useState(false);
const [currentModel, setCurrentModel] = useState({
name: "",
description: "",
});
const [modelToDelete, setModelToDelete] = useState(null);
const [errorMessage, setErrorMessage] = useState("");
useEffect(() => {
const getACCModels = async () => {
try {
const data = await fetchACCModels();
setModels(data);
} catch (error) {
console.error("Error fetching ACC models:", error);
}
};
getACCModels();
}, []);
const handleOpenModal = (model = { name: "", description: "" }) => {
setCurrentModel(model);
setErrorMessage("");
setIsModalOpen(true);
};
const handleCloseModal = () => {
setCurrentModel({ name: "", description: "" });
setErrorMessage("");
setIsModalOpen(false);
};
const handleOpenDialog = (modelId) => {
setModelToDelete(modelId);
setIsDialogOpen(true);
};
const handleCloseDialog = () => {
setModelToDelete(null);
setIsDialogOpen(false);
};
const handleChange = (e) => {
const { name, value } = e.target;
setCurrentModel((prev) => ({ ...prev, [name]: value }));
};
/**
* Saves the current ACC model to the server.
*
* If the current ACC model has an id, it will be updated. Otherwise, it will be created.
* If the save is successful, the list of ACC models is refetched and the modal is closed.
* If an error occurs, an error message is displayed.
*/
const handleSave = async () => {
try {
if (currentModel.id) {
await updateACCModel(currentModel.id, currentModel);
} else {
await createACCModel(currentModel);
}
const data = await fetchACCModels();
setModels(data);
handleCloseModal();
setErrorMessage("");
} catch (error) {
console.error("Error saving ACC model:", error);
if (error.response && error.response.status === 400) {
setErrorMessage("ACC model with this name already exists.");
} else {
setErrorMessage("An error occurred while saving the model.");
}
}
};
const handleDelete = async () => {
try {
await deleteACCModel(modelToDelete);
const data = await fetchACCModels();
setModels(data);
handleCloseDialog();
} catch (error) {
console.error("Error deleting ACC model:", error);
}
};
return (
<Container maxWidth="xl" classname="custom-container">
<Typography
variant="h4"
component="h1"
gutterBottom
sx={{ color: "primary.main" }}
>
ACC Models
</Typography>
<Typography variant="body1" sx={{ marginBottom: 3, color: "#7f8c8d" }}>
ACC Models are the starting point that ties everything together.
</Typography>
<Box display="flex" justifyContent="flex-start" mt={1} mb={3}>
<Button
variant="contained"
color="primary"
onClick={() => handleOpenModal()}
>
Create New ACC Model
</Button>
</Box>
<AccModelList
models={models}
handleOpenModal={handleOpenModal}
handleOpenDialog={handleOpenDialog}
/>
<AccModelForm
isOpen={isModalOpen}
model={currentModel}
handleChange={handleChange}
handleSave={handleSave}
handleClose={handleCloseModal}
errorMessage={errorMessage}
/>
<ConfirmDialog
isOpen={isDialogOpen}
handleClose={handleCloseDialog}
handleConfirm={handleDelete}
/>
</Container>
);
};
export default AccModels;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/Users.js
|
import React, { useEffect, useState } from "react";
import { Container, Typography} from "@mui/material";
import {
fetchUsers,
createUser,
updateUser,
deleteUser,
} from "../services/userService";
import UserForm from "../components/users/UserForm";
import UserList from "../components/users/UserList";
import ConfirmDialog from "../components/users/ConfirmDialog";
/**
* A React component for managing users.
*
* This component fetches a list of users from the server when it mounts,
* and displays them in a list. It also provides a button to create a new user,
* and a form to edit an existing user. The form is opened by clicking on a
* user in the list. The form is also used to delete an existing user.
*
* @returns {JSX.Element} The rendered React component.
*/
const Users = () => {
const [users, setUsers] = useState([]);
const [isModalOpen, setIsModalOpen] = useState(false);
const [isDialogOpen, setIsDialogOpen] = useState(false);
const [currentUser, setCurrentUser] = useState({
username: "",
email: "",
password: "",
});
const [userToDelete, setUserToDelete] = useState(null);
const [errorMessage, setErrorMessage] = useState("");
useEffect(() => {
const getUsers = async () => {
try {
const data = await fetchUsers();
setUsers(data);
} catch (error) {
console.error("Error fetching users:", error);
}
};
getUsers();
}, []);
const handleOpenModal = (
user = { username: "", email: "", password: "" }
) => {
setCurrentUser(user);
setErrorMessage("");
setIsModalOpen(true);
};
const handleCloseModal = () => {
setCurrentUser({ username: "", email: "", password: "" });
setErrorMessage("");
setIsModalOpen(false);
};
const handleOpenDialog = (userId) => {
setUserToDelete(userId);
setIsDialogOpen(true);
};
const handleCloseDialog = () => {
setUserToDelete(null);
setIsDialogOpen(false);
};
const handleChange = (e) => {
const { name, value } = e.target;
setCurrentUser((prev) => ({ ...prev, [name]: value }));
};
/**
* Saves the current user to the server.
*
* If the current user has an id, it will be updated. Otherwise, it will be created.
* If the save is successful, the list of users is refetched and the modal is closed.
* If an error occurs, an error message is displayed.
*/
const handleSave = async () => {
try {
if (currentUser.id) {
await updateUser(currentUser.id, currentUser);
} else {
await createUser(currentUser);
}
const data = await fetchUsers();
setUsers(data);
handleCloseModal();
setErrorMessage("");
} catch (error) {
console.error("Error saving User:", error);
if (error.response && error.response.status === 400) {
setErrorMessage("User with this name already exists.");
} else {
setErrorMessage("An error occurred while saving the User.");
}
}
};
const handleDelete = async () => {
try {
await deleteUser(userToDelete);
const data = await fetchUsers();
setUsers(data);
handleCloseDialog();
} catch (error) {
console.error("Error deleting user:", error);
}
};
return (
<Container maxWidth="xl" classname="custom-container">
<Typography variant="h4" component="h1" gutterBottom sx={{ color: "primary.main" }}>
Manage Users
</Typography>
<UserList
users={users}
handleOpenModal={handleOpenModal}
handleOpenDialog={handleOpenDialog}
/>
<UserForm
isOpen={isModalOpen}
user={currentUser}
handleChange={handleChange}
handleSave={handleSave}
handleClose={handleCloseModal}
errorMessage={errorMessage}
/>
<ConfirmDialog
isOpen={isDialogOpen}
handleClose={handleCloseDialog}
handleConfirm={handleDelete}
/>
</Container>
);
};
export default Users;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/Attributes.js
|
import React, { useEffect, useState } from "react";
import { Container, Typography, Box, Button } from "@mui/material";
import {
fetchAttributes,
createAttribute,
updateAttribute,
deleteAttribute,
} from "../services/attributeService";
import AttributeForm from "../components/attributes/AttributeForm";
import AttributeList from "../components/attributes/AttributeList";
import ConfirmDialog from "../components/attributes/ConfirmDialog";
/**
* A React component for displaying and managing attributes.
*
* The component provides a list of all attributes, a form for creating new
* attributes and editing existing ones, and a confirm dialog for deleting
* attributes.
*
* The attributes are fetched from the server when the component mounts and are
* stored in the component's state. The component also provides functions for
* creating, updating, and deleting attributes.
*/
const Attributes = () => {
const [attributes, setAttributes] = useState([]);
const [isModalOpen, setIsModalOpen] = useState(false);
const [isDialogOpen, setIsDialogOpen] = useState(false);
const [currentAttribute, setCurrentAttribute] = useState({
name: "",
description: "",
});
const [attributeToDelete, setAttributeToDelete] = useState(null);
const [errorMessage, setErrorMessage] = useState("");
useEffect(() => {
const getAttributes = async () => {
try {
const data = await fetchAttributes();
setAttributes(data);
} catch (error) {
console.error("Error fetching attributes:", error);
}
};
getAttributes();
}, []);
const handleOpenModal = (attribute = { name: "", description: "" }) => {
setCurrentAttribute(attribute);
setErrorMessage("");
setIsModalOpen(true);
};
const handleCloseModal = () => {
setCurrentAttribute({ name: "", description: "" });
setErrorMessage("");
setIsModalOpen(false);
};
const handleOpenDialog = (attributeId) => {
setAttributeToDelete(attributeId);
setIsDialogOpen(true);
};
const handleCloseDialog = () => {
setAttributeToDelete(null);
setIsDialogOpen(false);
};
const handleChange = (e) => {
const { name, value } = e.target;
setCurrentAttribute((prev) => ({ ...prev, [name]: value }));
};
/**
* Saves the current attribute to the server.
*
* If the current attribute has an id, it will be updated. Otherwise, it will be created.
* If the save is successful, the list of attributes is refetched and the modal is closed.
* If an error occurs, an error message is displayed.
*/
const handleSave = async () => {
try {
if (currentAttribute.id) {
await updateAttribute(currentAttribute.id, currentAttribute);
} else {
await createAttribute(currentAttribute);
}
const data = await fetchAttributes();
setAttributes(data);
handleCloseModal();
setErrorMessage("");
} catch (error) {
console.error("Error saving attribute:", error);
if (error.response && error.response.status === 400) {
setErrorMessage("Attribute with this name already exists.");
} else {
setErrorMessage("An error occurred while saving the Attribute.");
}
}
};
const handleDelete = async () => {
try {
await deleteAttribute(attributeToDelete);
const data = await fetchAttributes();
setAttributes(data);
handleCloseDialog();
} catch (error) {
console.error("Error deleting attribute:", error);
}
};
return (
<Container maxWidth="xl" classname="custom-container">
<Typography
variant="h4"
component="h1"
gutterBottom
sx={{ color: "primary.main" }}
>
Attributes
</Typography>
<Typography variant="body1" sx={{ marginBottom: 3, color: "#7f8c8d" }}>
Attributes are the qualities or characteristics (adjectives) that
describe the desired properties of your product, such as "Accuracy," or
"Responsiveness." <br />They help define the key qualities
that are important for your project.
</Typography>
<Box display="flex" justifyContent="flex-start" mt={1} mb={3}>
<Button
variant="contained"
color="primary"
onClick={() => handleOpenModal()}
>
Create New Attribute
</Button>
</Box>
<AttributeList
attributes={attributes}
handleOpenModal={handleOpenModal}
handleOpenDialog={handleOpenDialog}
/>
<AttributeForm
isOpen={isModalOpen}
attribute={currentAttribute}
handleChange={handleChange}
handleSave={handleSave}
handleClose={handleCloseModal}
errorMessage={errorMessage}
/>
<ConfirmDialog
isOpen={isDialogOpen}
handleClose={handleCloseDialog}
handleConfirm={handleDelete}
/>
</Container>
);
};
export default Attributes;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/Home.js
|
import React from "react";
import {
Container,
Typography,
Grid,
Button,
Box,
Link as MuiLink,
} from "@mui/material";
import { Link } from "react-router-dom";
const styles = {
heroSection: {
backgroundColor: "#708C70", // Sage green color
width: "100vw",
minHeight: "50vh",
display: "flex",
justifyContent: "center",
alignItems: "center",
flexDirection: "column",
position: "relative",
left: "50%",
marginLeft: "-50vw",
padding: "4rem 2rem",
textAlign: "center",
},
mainContainer: {
width: "100%",
maxWidth: "100vw",
overflowX: "hidden",
},
actionButton: {
margin: "0.5rem 1rem",
padding: "0.5rem 2rem",
backgroundColor: "#D1C6AD",
color: "#34495e",
fontWeight: "bold",
"&:hover": {
backgroundColor: "#B0A17F",
},
},
};
const Home = ({ isAuthenticated }) => {
return (
<Container style={styles.mainContainer}>
{/* Hero Section */}
<Box sx={styles.heroSection}>
<Typography variant="h3" sx={{ fontWeight: "bold", color: "#ffffff" }}>
Simplify Your Software Evaluation
</Typography>
<Typography
variant="h6"
sx={{ color: "#f0f0f0", maxWidth: "75%"}}
>
Effortlessly build a structured ACC model offering clarity and
coverage for effective testing.
</Typography>
{!isAuthenticated && (
<Box display="flex" justifyContent="center" gap={2} sx={{marginBottom: "2rem", marginTop: "2rem" }}>
<Button
component={Link}
to="/registration"
variant="contained"
sx={styles.actionButton}
>
Register
</Button>
<Button
component={Link}
to="/token"
variant="contained"
sx={styles.actionButton}
>
Login
</Button>
</Box>
)}
<Typography
variant="body1"
sx={{ color: "#FCFCFC", maxWidth: "80%"}}
>
Start by creating an ACC Model, then define key Attributes, add
Components, and map Capabilities.
</Typography>
<Button
component={Link}
to="/acc-models"
variant="contained"
sx={styles.actionButton}
>
Get Started
</Button>
</Box>
{/* Main Content - Features Section */}
<Box sx={{ backgroundColor: "#f8f8f8", padding: "4rem 2rem" }}>
<Grid container spacing={4} justifyContent="center">
<Grid item xs={12} sm={6} md={4}>
<Box
sx={{
padding: 2,
boxShadow: 3,
borderRadius: 2,
backgroundColor: "#ffffff",
}}
>
<Typography
variant="h6"
sx={{ fontWeight: "bold", marginBottom: 1 }}
>
Submit Ratings
</Typography>
<Typography variant="body2" color="textSecondary">
Rate and evaluate each component for accurate insights.
</Typography>
<Button
component={Link}
to="/ratings"
variant="contained"
sx={{ marginTop: 2, backgroundColor: "#708C70" }}
>
Go to Ratings
</Button>
</Box>
</Grid>
{/* New Feature Card for Dashboard */}
<Grid item xs={12} sm={6} md={4}>
<Box
sx={{
padding: 2,
boxShadow: 3,
borderRadius: 2,
backgroundColor: "#ffffff",
}}
>
<Typography
variant="h6"
sx={{ fontWeight: "bold", marginBottom: 1 }}
>
Dashboard
</Typography>
<Typography variant="body2" color="textSecondary">
View a comprehensive overview of your project ratings.
</Typography>
<Button
component={Link}
to="/dashboard"
variant="contained"
sx={{ marginTop: 2, backgroundColor: "#708C70" }}
>
Go to Dashboard
</Button>
</Box>
</Grid>
{/* New Feature Card for Ratings Trends */}
<Grid item xs={12} sm={6} md={4}>
<Box
sx={{
padding: 2,
boxShadow: 3,
borderRadius: 2,
backgroundColor: "#ffffff",
}}
>
<Typography
variant="h6"
sx={{ fontWeight: "bold", marginBottom: 1 }}
>
Ratings Trends
</Typography>
<Typography variant="body2" color="textSecondary">
Track ratings over time and analyze historical data.
</Typography>
<Button
component={Link}
to="/historical-comparison"
variant="contained"
sx={{ marginTop: 2, backgroundColor: "#708C70" }}
>
Go to Trends
</Button>
</Box>
</Grid>
</Grid>
</Box>
<Box
sx={{ padding: 2, marginTop: 6, textAlign: "center", color: "black" }}
>
<Typography variant="body2">
Developed by{" "}
<MuiLink href="https://www.qxf2.com" target="_blank" color="inherit">
Qxf2 Services
</MuiLink>{" "}
|{" "}
<MuiLink
href="https://github.com/qxf2/acc-model-app"
target="_blank"
color="inherit"
>
GitHub
</MuiLink>
</Typography>
</Box>
</Container>
);
};
export default Home;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/Login.js
|
import React, { useState } from "react";
import { Button, TextField, Typography, Container } from "@mui/material";
import { useNavigate } from "react-router-dom";
import { login } from "../services/loginService";
/**
* A React component for logging in to the application.
*
* This component renders a login form with fields for username and password.
* When the form is submitted, it calls the `login` function and stores the
* returned access token in local storage. It also calls the `onLoginSuccess`
* function, which is passed in as a prop, to allow the parent component to
* handle the login success.
*
* @param {function} onLoginSuccess - A function to be called after a successful
* login.
*/
const Login = ({ onLoginSuccess }) => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [error, setError] = useState(null);
const navigate = useNavigate();
const handleLogin = async () => {
try {
const { access_token } = await login(username, password);
// Token expiration time is 300 minutes (5 hours)
const EXPIRATION_TIME_MINUTES = 300;
const expirationTimestamp =
Date.now() + EXPIRATION_TIME_MINUTES * 60 * 1000;
localStorage.setItem("authToken", access_token);
localStorage.setItem("tokenExpiry", expirationTimestamp);
console.log("Token expiry time", expirationTimestamp);
onLoginSuccess();
navigate("/");
}
catch (err) {
if (err.response) {
if (err.response.status === 400) {
setError("Username and password must be provided.");
}
else if (err.response.status === 404) {
setError("User does not exist. Please register first.");
}
else if (err.response.status === 401) {
setError("Incorrect username or password.");
}
else {
setError("An unexpected error occurred. Please try again.");
}
} else {
setError("An unexpected error occurred. Please try again.");
}
}
};
return (
<Container maxWidth="sm" style={{ marginTop: "2rem" }}>
<Typography variant="h4" component="h1" gutterBottom>
Login
</Typography>
<TextField
label="Username"
value={username}
onChange={(e) => setUsername(e.target.value)}
fullWidth
margin="normal"
/>
<TextField
label="Password"
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
fullWidth
margin="normal"
/>
{error && <Typography color="error">{error}</Typography>}
<Button
variant="contained"
color="primary"
onClick={handleLogin}
fullWidth
style={{ marginTop: "1rem" }}
>
Login
</Button>
</Container>
);
};
export default Login;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/HistoricalComparison.js
|
import React, { useState, useEffect } from "react";
import {
Box,
TextField,
Container,
Grid,
Typography,
MenuItem,
Accordion,
AccordionDetails,
AccordionSummary,
} from "@mui/material";
import { Bar } from "react-chartjs-2";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import { fetchHistoricalGraphData, fetchBulkCapabilityAssessmentIDs } from "../services/ratingsService";
import { fetchAttributes } from "../services/attributeService";
import { fetchACCModels, fetchComponents } from "../services/componentService";
import { fetchCapabilities } from "../services/capabilitiesService";
import { Chart, BarElement, CategoryScale, LinearScale, Title, Tooltip, Legend } from "chart.js";
// Register Chart.js components
Chart.register(BarElement, CategoryScale, LinearScale, Title, Tooltip, Legend);
const getRandomColor = () => {
const letters = "0123456789ABCDEF";
let color = "#";
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
};
const HistoricalComparison = () => {
const [selectedAccModel, setSelectedAccModel] = useState("");
const [components, setComponents] = useState([]);
const [expandedComponent, setExpandedComponent] = useState(null);
const [accModels, setAccModels] = useState([]);
const [startDate, setStartDate] = useState("");
const [endDate, setEndDate] = useState("");
const [graphData, setGraphData] = useState(null);
const [capabilityNames, setCapabilityNames] = useState([]);
const [attributeNames, setAttributeNames] = useState([]);
const [attributeColors, setAttributeColors] = useState({});
const [attributeIds, setAttributeIds] = useState([]);
// Fetch initial ACC Models
useEffect(() => {
const fetchAccModels = async () => {
const accModelsData = await fetchACCModels();
setAccModels(accModelsData);
console.log("Fetched ACC Models", accModelsData);
};
fetchAccModels();
}, []);
// Fetch data based on selected ACC Model
useEffect(() => {
const fetchData = async () => {
if (!selectedAccModel) return;
try {
const components = await fetchComponents(selectedAccModel);
setComponents(components);
console.log("Fetched Components for selected ACC Model:", components);
const attributes = await fetchAttributes();
const attributeNamesFetched = attributes.map((attr) => attr.name);
const attributeIdsFetched = attributes.map((attr) => attr.id);
setAttributeIds(attributeIdsFetched);
setAttributeNames(attributeNamesFetched);
console.log("Fetched Attributes:", attributes);
const colors = {};
attributeNamesFetched.forEach((attribute) => {
colors[attribute] = getRandomColor();
});
setAttributeColors(colors);
} catch (error) {
console.error("Error fetching data:", error);
}
};
fetchData();
}, [selectedAccModel]);
// Function to handle selecting an ACC Model
const handleAccModelChange = (event) => {
setSelectedAccModel(event.target.value);
setComponents([]);
};
// Handle accordion expansion and fetch data for the expanded component only
const handleAccordionChange = async (componentId) => {
const isExpanding = expandedComponent !== componentId;
setExpandedComponent(isExpanding ? componentId : null);
if (isExpanding) {
try {
const capabilities = await fetchCapabilities(componentId);
const capabilityIds = capabilities.map((cap) => cap.id);
setCapabilityNames(capabilities.map((cap) => cap.name));
const capabilityAssessmentData = await fetchBulkCapabilityAssessmentIDs(capabilityIds, attributeIds);
const capabilityAssessmentIds = capabilityAssessmentData.map(item => item.capability_assessment_id);
const data = await fetchHistoricalGraphData(
capabilityAssessmentIds,
startDate,
endDate
);
setGraphData(data);
console.log("Graph data for expanded component:", componentId, data);
} catch (error) {
console.error("Error fetching capabilities:", error);
}
} else {
setGraphData(null);
setCapabilityNames([]);
}
};
// Prepare data for the charts
const prepareChartData = (dateType) => {
if (!graphData) return null;
const dateData = graphData[dateType];
const datasets = attributeNames.map(attribute => {
const data = capabilityNames.map(capability => {
const foundData = dateData.find(
item => item.capability_name === capability && item.attribute_name === attribute
);
return foundData ? foundData.average_rating : 0;
});
return {
label: attribute,
data,
backgroundColor: attributeColors[attribute],
};
});
return {
labels: capabilityNames,
datasets,
};
};
const options = {
responsive: true,
plugins: {
legend: { position: "top" },
title: { display: true, text: "Ratings Comparison" },
},
scales: {
y: {
beginAtZero: true,
max: 5,
ticks: { stepSize: 1 },
},
},
};
return (
<Container maxWidth="xl" classname="custom-container">
<Typography variant="h4" component="h1" gutterBottom sx={{ color: "primary.main" }}>
Ratings Trends
</Typography>
<Typography
variant="body1"
style={{ marginBottom: "1.5rem", color: "#primary.main" }}
>
Explore historical rating trends for different components within the selected ACC Model.
Use this comparison tool to analyze rating shifts over specific time frames.
</Typography>
<Typography
variant="body2"
style={{ marginBottom: "2rem", color: "text.secondary" }}
>
To get started, first select the ACC Model from the dropdown. Next, choose your desired start and end dates.
Finally, expand each component to view the detailed ratings.
</Typography>
<Box display="flex" justifyContent="flex-start" mb={3}>
<TextField
select
label="Select ACC Model"
value={selectedAccModel}
onChange={handleAccModelChange}
variant="outlined"
margin="normal"
sx={{ width: "400px" }}
>
{accModels.map((model) => (
<MenuItem key={model.id} value={model.id}>{model.name}</MenuItem>
))}
</TextField>
</Box>
<Box display="flex" gap={2} mb={3}>
<TextField
label="Start Date"
type="date"
value={startDate}
onChange={(e) => setStartDate(e.target.value)}
sx={{ width: '300px' }}
InputLabelProps={{ shrink: true }}
/>
<TextField
label="End Date"
type="date"
value={endDate}
onChange={(e) => setEndDate(e.target.value)}
sx={{ width: '300px' }}
InputLabelProps={{ shrink: true }}
/>
</Box>
{components.length > 0 && (
<Box mt={4}>
<Typography variant="h6" gutterBottom>Components</Typography>
{components.map((component) => (
<Accordion
key={component.id}
expanded={expandedComponent === component.id}
onChange={() => handleAccordionChange(component.id)}
>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<Typography>{component.name}</Typography>
</AccordionSummary>
<AccordionDetails>
{expandedComponent === component.id && graphData ? (
<>
<Typography variant="h6" gutterBottom>Start Date Ratings</Typography>
<Bar data={prepareChartData("start_date")} options={options} />
<Typography variant="h6" gutterBottom style={{ marginTop: "2rem" }}>End Date Ratings</Typography>
<Bar data={prepareChartData("end_date")} options={options} />
</>
) : (
<Typography>Select dates and expand to view the graph</Typography>
)}
</AccordionDetails>
</Accordion>
))}
</Box>
)}
</Container>
);
};
export default HistoricalComparison;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/Components.js
|
import React, { useEffect, useState } from "react";
import { Container, Typography, Box, Button } from "@mui/material";
import {
fetchACCModels,
fetchComponents,
createComponent,
updateComponent,
deleteComponent,
} from "../services/componentService";
import ComponentForm from "../components/components/ComponentForm";
import ComponentList from "../components/components/ComponentList";
import AccModelSelector from "../components/components/AccModelSelector";
import ConfirmDialog from "../components/components/ConfirmDialog";
/**
* A React component for displaying and editing components for a selected
* ACC model.
*
* The component displays a list of components for the selected ACC model,
* and for each component, it displays a link to edit the component and a
* button to delete the component. The component also displays a form to
* create a new component.
*
* The component fetches the list of ACC models and the list of components for
* the selected ACC model from the server when it mounts.
*
* @returns {JSX.Element} The rendered React component.
*/
const Components = () => {
const [accModels, setAccModels] = useState([]);
const [selectedAccModel, setSelectedAccModel] = useState("");
const [components, setComponents] = useState([]);
const [isModalOpen, setIsModalOpen] = useState(false);
const [isDialogOpen, setIsDialogOpen] = useState(false);
const [currentComponent, setCurrentComponent] = useState({
name: "",
description: "",
});
const [componentToDelete, setComponentToDelete] = useState(null);
const [errorMessage, setErrorMessage] = useState("");
useEffect(() => {
const getACCModels = async () => {
try {
const data = await fetchACCModels();
setAccModels(data);
} catch (error) {
console.error("Error fetching ACC models:", error);
}
};
getACCModels();
}, []);
useEffect(() => {
if (selectedAccModel) {
const getComponents = async () => {
try {
const data = await fetchComponents(selectedAccModel);
setComponents(data);
} catch (error) {
console.error("Error fetching components:", error);
}
};
getComponents();
}
}, [selectedAccModel]);
const handleOpenModal = (
component = { name: "", description: "", acc_model_id: selectedAccModel }
) => {
setCurrentComponent(component);
setErrorMessage("");
setIsModalOpen(true);
};
const handleCloseModal = () => {
setCurrentComponent({
name: "",
description: "",
acc_model_id: selectedAccModel,
});
setErrorMessage("");
setIsModalOpen(false);
};
const handleOpenDialog = (componentId) => {
setComponentToDelete(componentId);
setIsDialogOpen(true);
};
const handleCloseDialog = () => {
setComponentToDelete(null);
setIsDialogOpen(false);
};
const handleChange = (e) => {
const { name, value } = e.target;
setCurrentComponent((prev) => ({ ...prev, [name]: value }));
};
const handleSave = async () => {
try {
if (currentComponent.id) {
await updateComponent(currentComponent.id, currentComponent);
} else {
await createComponent(currentComponent);
}
const data = await fetchComponents(selectedAccModel);
setComponents(data);
handleCloseModal();
} catch (error) {
console.error("Error saving component:", error);
if (error.response && error.response.status === 400) {
setErrorMessage("Component with this name already exists.");
} else {
setErrorMessage("An error occurred while saving the component.");
}
}
};
const handleDelete = async () => {
try {
await deleteComponent(componentToDelete);
const data = await fetchComponents(selectedAccModel);
setComponents(data);
handleCloseDialog();
} catch (error) {
console.error("Error deleting component:", error);
}
};
return (
<Container maxWidth="xl" classname="custom-container">
<Typography
variant="h4"
component="h1"
gutterBottom
sx={{ color: "primary.main" }}
>
Components
</Typography>
<Typography variant="body1" sx={{ marginBottom: 3, color: "#7f8c8d" }}>
Components are the major sections or building blocks (nouns) of your
product such as "User Management," "Shopping Cart," etc. <br />They represent
the core structural pieces that make up the project.
</Typography>
<Typography variant="body2" color="textSecondary" paragraph>
Remember to create an ACC Model first before listing components.
</Typography>
<Box display="flex" justifyContent="flex-start" mb={3}>
<AccModelSelector
accModels={accModels}
selectedAccModel={selectedAccModel}
handleSelect={setSelectedAccModel}
/>
</Box>
<Box display="flex" justifyContent="flex-start" mt={1} mb={3}>
<Button
variant="contained"
color="primary"
onClick={() => handleOpenModal()}
disabled={!selectedAccModel}
>
Create New Component
</Button>
</Box>
<ComponentList
components={components}
handleOpenModal={handleOpenModal}
handleOpenDialog={handleOpenDialog}
/>
<ComponentForm
isOpen={isModalOpen}
component={currentComponent}
handleChange={handleChange}
handleSave={handleSave}
handleClose={handleCloseModal}
errorMessage={errorMessage}
/>
<ConfirmDialog
isOpen={isDialogOpen}
handleClose={handleCloseDialog}
handleConfirm={handleDelete}
/>
</Container>
);
};
export default Components;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/Capabilities.js
|
import React, { useEffect, useState } from "react";
import { Container, Typography, Box } from "@mui/material";
import AccModelSelector from "../components/capabilities/AccModelSelector";
import CapabilityForm from "../components/capabilities/CapabilityForm";
import CapabilityList from "../components/capabilities/CapabilityList";
import ConfirmDialog from "../components/capabilities/ConfirmDialog";
import {
fetchACCModels,
fetchComponents,
fetchCapabilities,
createCapability,
updateCapability,
deleteCapability,
} from "../services/capabilitiesService";
/**
* A React component for displaying and editing capabilities for a selected
* ACC model.
*
* The component displays a list of components for the selected ACC model,
* and for each component, it displays a list of capabilities. The user can
* create a new capability, edit an existing capability, or delete a capability.
* The component also displays a confirmation dialog when the user clicks the
* delete button.
*
* The component fetches the list of ACC models and the list of components for
* the selected ACC model from the server when it mounts.
*
* @returns {JSX.Element} The rendered React component.
*/
const Capabilities = () => {
const [accModels, setAccModels] = useState([]);
const [selectedAccModel, setSelectedAccModel] = useState("");
const [components, setComponents] = useState([]);
const [capabilities, setCapabilities] = useState({});
const [isModalOpen, setIsModalOpen] = useState(false);
const [isDialogOpen, setIsDialogOpen] = useState(false);
const [currentCapability, setCurrentCapability] = useState({
name: "",
description: "",
component_id: "",
});
const [capabilityToDelete, setCapabilityToDelete] = useState(null);
const [errorMessage, setErrorMessage] = useState("");
useEffect(() => {
const getACCModels = async () => {
try {
const data = await fetchACCModels();
setAccModels(data);
} catch (error) {
console.error("Error fetching ACC models:", error);
}
};
getACCModels();
}, []);
useEffect(() => {
if (selectedAccModel) {
const getComponents = async () => {
try {
const data = await fetchComponents(selectedAccModel);
setComponents(data);
const capabilitiesData = {};
for (const component of data) {
const caps = await fetchCapabilities(component.id);
capabilitiesData[component.id] = caps;
}
setCapabilities(capabilitiesData);
} catch (error) {
console.error("Error fetching components:", error);
}
};
getComponents();
}
}, [selectedAccModel]);
const handleOpenModal = (
componentId,
capability = { name: "", description: "", component_id: componentId }
) => {
setCurrentCapability(capability);
setErrorMessage("");
setIsModalOpen(true);
};
const handleCloseModal = () => {
setCurrentCapability({ name: "", description: "", component_id: "" });
setErrorMessage("");
setIsModalOpen(false);
};
const handleOpenDialog = (capabilityId, componentId) => {
setCapabilityToDelete(capabilityId);
setCurrentCapability((prev) => ({
...prev,
component_id: componentId,
}));
setIsDialogOpen(true);
};
const handleCloseDialog = () => {
setCapabilityToDelete(null);
setIsDialogOpen(false);
};
const handleChange = (e) => {
const { name, value } = e.target;
setCurrentCapability((prev) => ({ ...prev, [name]: value }));
};
/**
* Saves the current capability to the server.
*
* If the current capability has an id, it will be updated. Otherwise, it will be created.
* If the save is successful, the list of capabilities is refetched and the modal is closed.
* If an error occurs, an error message is displayed.
*/
const handleSave = async () => {
try {
if (currentCapability.id) {
await updateCapability(currentCapability.id, currentCapability);
} else {
await createCapability(currentCapability);
}
const updatedCapabilities = await fetchCapabilities(
currentCapability.component_id
);
setCapabilities((prev) => ({
...prev,
[currentCapability.component_id]: updatedCapabilities,
}));
setErrorMessage("");
handleCloseModal();
} catch (error) {
console.error("Error saving capability:", error);
if (error.response && error.response.status === 400) {
setErrorMessage("Capability with this name already exists.");
} else {
setErrorMessage("An error occurred while saving the capability.");
}
}
};
const handleDelete = async () => {
try {
await deleteCapability(capabilityToDelete);
const updatedCapabilities = await fetchCapabilities(
currentCapability.component_id
);
setCapabilities((prevCapabilities) => ({
...prevCapabilities,
[currentCapability.component_id]: updatedCapabilities,
}));
handleCloseDialog();
} catch (error) {
console.error("Error deleting capability:", error);
}
};
return (
<Container maxWidth="xl" classname="custom-container">
<Typography
variant="h4"
component="h1"
gutterBottom
sx={{ color: "primary.main" }}
>
Capabilities
</Typography>
<Typography variant="body1" sx={{ marginBottom: 3, color: "#7f8c8d" }}>
Capabilities are the specific features or functionalities (verbs) that
each Component has, such as "Add User", "Process Payment." etc. <br /> They
help define what each Component can do.
</Typography>
<Box display="flex" justifyContent="flex-start" mb={3}>
<AccModelSelector
accModels={accModels}
selectedAccModel={selectedAccModel}
onSelectAccModel={setSelectedAccModel}
/>
</Box>
<CapabilityList
components={components}
capabilities={capabilities}
onEdit={handleOpenModal}
onDelete={handleOpenDialog}
onCreate={handleOpenModal}
/>
<CapabilityForm
isOpen={isModalOpen}
onClose={handleCloseModal}
capability={currentCapability}
onChange={handleChange}
onSave={handleSave}
errorMessage={errorMessage}
/>
<ConfirmDialog
isOpen={isDialogOpen}
onClose={handleCloseDialog}
onConfirm={handleDelete}
/>
</Container>
);
};
export default Capabilities;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/AggregateRatings.js
|
import React, { useEffect, useState } from "react";
import {
Box,
Container,
Typography,
MenuItem,
TextField,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
Paper,
IconButton,
} from "@mui/material";
import Grid from "@mui/material/Unstable_Grid2";
import { ExpandMore, ExpandLess } from "@mui/icons-material";
import {
fetchACCModels,
fetchAttributes,
fetchComponentsByAccModel,
fetchCapabilitiesByComponent,
fetchBulkAggregatedRatings,
fetchBulkCapabilityAssessmentIDs,
} from "../services/ratingsService";
import { Pie } from "react-chartjs-2";
import { Chart, ArcElement } from "chart.js";
Chart.register(ArcElement);
// Mapping of rating thresholds to descriptions
const THRESHOLD_RATING_MAPPING = {
Stable: [3.5, 4],
Acceptable: [2.5, 3.49],
"Low impact": [1.5, 2.49],
"Critical Concern": [0, 1.49],
"Not Applicable": [0, 0],
};
// Maps rating description to corresponding colors used for visualizations
const RATING_COLOR_MAPPING = {
Stable: "#8BC34A", // Green
Acceptable: "#A3C1DA", // Light Blue
"Low impact": "#f5b877", // Orange
"Critical Concern": "#e57373", // Red
"Not Applicable": "#b0b0b0", // Gray
"No Rating": "#E0E0E0",
};
/**
* The main component for the dashboard page.
* It contains the following sub-components:
* - A dropdown to select an ACC model.
* - A heatmap to display the ratings of the capabilities in a 2D matrix.
* - A tree table view to display the components, their capabilities, and the ratings.
* - A pie chart to display the distribution of the ratings.
* @returns {React.ReactElement} The JSX element representing the dashboard page.
*/
const Dashboard = () => {
// State for holding ACC models, selected model, components, capabilities, and other data
const [accModels, setAccModels] = useState([]);
const [selectedAccModel, setSelectedAccModel] = useState("");
const [components, setComponents] = useState([]);
const [capabilities, setCapabilities] = useState([]);
const [expandedComponents, setExpandedComponents] = useState({});
const [attributes, setAttributes] = useState([]);
const [capabilityAssessments, setCapabilityAssessments] = useState({});
const [aggregatedRatings, setAggregatedRatings] = useState({});
/**
* Returns the rating description for the given average rating.
* If average rating is null, returns "No Rating".
* If average rating does not fall within any of the predefined
* rating thresholds, returns "N/A".
* @param {number} averageRating
* @returns {string}
*/
function getRatingDescription(averageRating) {
if (averageRating === null) {
return "No Rating";
}
for (const [description, range] of Object.entries(
THRESHOLD_RATING_MAPPING
)) {
const [min, max] = range;
if (averageRating >= min && averageRating <= max) {
return description;
}
}
return "N/A";
}
/**
* Returns the color to be used for visualizations given a rating description.
* If no color is found in RATING_COLOR_MAPPING, returns "#ffffff".
* @param {string} ratingDescription
* @returns {string}
*/
function mapRatingToColor(ratingDescription) {
return RATING_COLOR_MAPPING[ratingDescription] || "#ffffff";
}
/**
* Fetches ACC models and attributes when the component mounts.
* Stores the data in state.
*/
useEffect(() => {
const fetchData = async () => {
try {
// Fetch ACC models
const accModelsData = await fetchACCModels();
setAccModels(accModelsData);
// Fetch attributes
const attributesData = await fetchAttributes();
setAttributes(attributesData);
} catch (error) {
console.error("Error fetching initial data:", error);
}
};
// Call the function to fetch the data, runs once on component mount
fetchData();
}, []);
/**
* Fetches components for the selected ACC model when the selected ACC model changes.
* Stores the data in the components state.
*/
useEffect(() => {
if (selectedAccModel) {
const fetchComponentsData = async () => {
try {
// Fetch components for the selected ACC model
const componentsData = await fetchComponentsByAccModel(
selectedAccModel
);
// Store the components in the state
setComponents(componentsData);
} catch (error) {
console.error("Error fetching components:", error);
}
};
// Call the function to fetch the components, runs whenever 'selectedAccModel' changes
fetchComponentsData();
}
}, [selectedAccModel]);
/**
* Fetches capabilities for all components when the components change.
* Stores the data in the capabilities state.
*/
useEffect(() => {
if (components.length > 0) {
const fetchCapabilitiesData = async () => {
try {
// Fetch capabilities for all components
const allCapabilities = await Promise.all(
components.map(async (component) => {
const capabilitiesData = await fetchCapabilitiesByComponent(
component.id
);
return {
componentId: component.id,
capabilities: capabilitiesData,
};
})
);
// Store the capabilities in the state
setCapabilities(allCapabilities);
} catch (error) {
console.error("Error fetching capabilities:", error);
}
};
const expanded = {};
components.forEach((component) => {
expanded[component.id] = true; // Set all components to expanded by default
});
setExpandedComponents(expanded); // Update state with expanded components
fetchCapabilitiesData();
}
}, [components]); // Runs when 'components' array is updated
/**
* Fetches capability assessments and aggregated ratings
* when capabilities and attributes are available.
*/
useEffect(() => {
const fetchCapabilityAssessmentsAndRatings = async () => {
// If there are capabilities and attributes, fetch the capability assessments
if (capabilities.length > 0 && attributes.length > 0) {
try {
// Fetch capability assessment IDs in bulk
const capabilityIds = capabilities.flatMap((cap) =>
cap.capabilities.map((c) => c.id)
);
const attributeIds = attributes.map((attr) => attr.id);
const assessmentData = await fetchBulkCapabilityAssessmentIDs(
capabilityIds,
attributeIds
);
const assessmentMap = {}; // Store the mapping of capability-attribute pairs to assessment IDs
const assessmentIds = []; // Collect all the capability assessment IDs for fetching ratings
// Map capability and attribute IDs to capability assessment IDs
assessmentData.forEach((assessment) => {
const key = `${assessment.capability_id}-${assessment.attribute_id}`;
assessmentMap[key] = assessment.capability_assessment_id; // Map capability-attribute pair to assessment ID
assessmentIds.push(assessment.capability_assessment_id);
});
setCapabilityAssessments(assessmentMap);
// Fetch aggregated ratings for the capability assessments
const aggregatedRatings = await fetchBulkAggregatedRatings(
assessmentIds
);
const aggregatedRatingsMap = {}; // To store rating description for each capability assessment ID
// Map the aggregated ratings to the assessment IDs
aggregatedRatings.forEach((rating) => {
const description = getRatingDescription(rating.average_rating);
aggregatedRatingsMap[rating.capability_assessment_id] = description;
});
setAggregatedRatings(aggregatedRatingsMap);
} catch (error) {
console.error(
"Error fetching capability assessment data or ratings:",
error
);
}
}
};
// Trigger data fetch if capabilities and attributes are populated
if (capabilities.length > 0 && attributes.length > 0) {
fetchCapabilityAssessmentsAndRatings();
}
}, [capabilities, attributes]);
/**
* Handles expanding or collapsing a component's capability list
* @param {number} componentId - ID of the component to expand or collapse
*/
const handleToggleExpand = (componentId) => {
setExpandedComponents((prevState) => ({
...prevState, // Copy previous state
[componentId]: !prevState[componentId],
}));
};
/**
* Calculates the count of each rating description in the aggregated ratings.
* @returns {Object} A mapping of rating description to count.
*/
const getRatingCounts = () => {
const counts = {
Stable: 0,
Acceptable: 0,
"Low impact": 0,
"Critical Concern": 0,
"Not Applicable": 0,
};
// Iterate through all aggregated ratings and increment the count for the respective rating category
Object.values(aggregatedRatings).forEach((ratingDescription) => {
counts[ratingDescription] = (counts[ratingDescription] || 0) + 1;
});
return counts;
};
// Calculate the count of each rating in the aggregated ratings
const ratingCounts = getRatingCounts();
// Create data for the pie chart
const pieData = {
labels: Object.keys(ratingCounts),
datasets: [
{
label: "# of Capabilities",
// Data values for each wedge of the pie chart
data: Object.values(ratingCounts),
backgroundColor: Object.keys(RATING_COLOR_MAPPING).map(
(rating) => RATING_COLOR_MAPPING[rating]
),
hoverBackgroundColor: Object.keys(RATING_COLOR_MAPPING).map(
(rating) => RATING_COLOR_MAPPING[rating]
),
},
],
};
// Configure the pie chart to be responsive and not maintain its aspect ratio.
// This ensures the chart is displayed with a consistent size, regardless of the
// available space.
const pieOptions = {
responsive: true,
maintainAspectRatio: false,
};
return (
<Container maxWidth="xl" classname="custom-container">
<Typography
variant="h4"
component="h1"
gutterBottom
sx={{ color: "primary.main" }}
>
Capability Ratings Dashboard
</Typography>
<Typography
variant="body1"
style={{ marginBottom: "1.5rem", color: "#primary.main" }}
>
Review and analyze the consolidated ratings for each capability. This
dashboard provides an overview of user evaluations across all
capabilities, helping you identify strengths, areas for improvement, and
overall performance.
</Typography>
<Box display="flex" justifyContent="flex-start" mb={3}>
<TextField
select
label="Select ACC Model"
value={selectedAccModel}
onChange={(e) => setSelectedAccModel(e.target.value)}
variant="outlined"
margin="normal"
sx={{ width: "400px" }}
>
{accModels.map((model) => (
<MenuItem key={model.id} value={model.id}>
{model.name}
</MenuItem>
))}
</TextField>
</Box>
{/* Heatmap */}
{selectedAccModel && (
<Grid container spacing={3}>
<Grid xs={6}>
<Typography
variant="h6"
component="h2"
gutterBottom
style={{ fontWeight: "bold", color: "primary.main" }}
>
Capability Ratings Heatmap
</Typography>
<TableContainer
component={Paper}
style={{
height: "300px", // Fixed height for the heatmap
width: "100%",
overflow: "hidden", // Ensures table does not overflow
display: "flex",
justifyContent: "center",
padding: "10px",
}}
>
<Table
style={{
width: "100%", //Full width to fill the container
height: "100%", // Full height to fill the container
tableLayout: "fixed",
}}
>
<TableBody>
{components.map((component) =>
capabilities
.filter((cap) => cap.componentId === component.id)
.flatMap((cap) => cap.capabilities)
.map((capability) => (
<TableRow key={capability.id}>
{attributes.map((attribute) => {
const key = `${capability.id}-${attribute.id}`;
const capabilityAssessmentId =
capabilityAssessments[key];
const ratingDescription =
aggregatedRatings[capabilityAssessmentId] ||
"N/A";
const ratingColor =
mapRatingToColor(ratingDescription);
return (
<TableCell
key={capabilityAssessmentId}
style={{
backgroundColor: ratingColor,
fontSize: "0.875rem",
padding: "2px",
}}
>
{/* Empty cell for heatmap (no rating text) */}
</TableCell>
);
})}
</TableRow>
))
)}
</TableBody>
</Table>
</TableContainer>
</Grid>
{/* Pie Chart */}
<Grid xs={6}>
<Typography
variant="h6"
component="h2"
gutterBottom
style={{ fontWeight: "bold", color: "primary.main" }}
>
Ratings Distribution
</Typography>
<Paper
style={{
height: "300px",
width: "100%",
padding: "20px",
}}
>
<Pie data={pieData} options={pieOptions} />
</Paper>
</Grid>
</Grid>
)}
{/* Tree Table View */}
{selectedAccModel && (
<Box mt={5}>
{/* Table to show the component, attribute and capability and their ratings */}
<Typography
variant="h6"
component="h2"
gutterBottom
style={{ fontWeight: "bold", color: "primary.main" }}
>
Component and Capability Ratings
</Typography>
<TableContainer
component={Paper}
style={{ marginTop: "2rem", width: "100%", overflow: "auto" }}
>
<Table style={{ tableLayout: "fixed" }}>
<TableHead>
<TableRow>
{/* First table cell for Component/Capability names */}
<TableCell
style={{
width: "200px", // Fixed width for the first column
fontSize: "1rem",
fontWeight: "bold",
backgroundColor: "#E4EFED",
}}
>
{/* Capability/Component Name */}
</TableCell>
{/* Show all the attributes as table headers (dynamically render) */}
{attributes.map((attribute) => (
<TableCell
key={attribute.id}
style={{
width: "100px", // Fixed width for each attribute column
fontSize: "1rem",
fontWeight: "bold",
color: "#2E403B",
backgroundColor: "#E4EFED",
minWidth: "150px", // Ensures each column has a minimum width
overflowWrap: "break-word", // Allow long text to wrap
whiteSpace: "normal", // Prevents long words from overflowing
}}
>
{attribute.name}
</TableCell>
))}
</TableRow>
</TableHead>
<TableBody>
{/* Loop through all the components and their corresponding capabilities */}
{components.map((component) => (
<React.Fragment key={component.id}>
<TableRow>
<TableCell
style={{
fontSize: "1.125rem",
backgroundColor: "#E4EFED",
}}
>
<Box display="flex" alignItems="center">
{/* Expand or collapse the component */}
<IconButton
onClick={() => handleToggleExpand(component.id)}
>
{expandedComponents[component.id] ? (
<ExpandLess />
) : (
<ExpandMore />
)}
</IconButton>
{/* Show the component name */}
<Typography
variant="h6"
component="h2"
style={{ fontSize: "1rem", fontWeight: "bold" }}
>
{component.name}
</Typography>
</Box>
</TableCell>
{/* Show empty cells for the Component row */}
{attributes.map((attribute) => (
<TableCell
key={attribute.id}
style={{
backgroundColor: "#E4EFED",
}}
></TableCell>
))}
</TableRow>
{/* Show the capabilities of the component if it is expanded */}
{expandedComponents[component.id] &&
capabilities
.filter((cap) => cap.componentId === component.id)
.flatMap((cap) => cap.capabilities)
.map((capability) => (
<TableRow key={capability.id}>
<TableCell
style={{
fontSize: "1rem",
backgroundColor: "#E4EFED",
}}
>
{/* Show the capability name indented */}
<Box ml={4}>{capability.name}</Box>
</TableCell>
{/* Show the ratings of the capability for each attribute */}
{attributes.map((attribute) => {
const key = `${capability.id}-${attribute.id}`;
const capabilityAssessmentId =
capabilityAssessments[key];
const ratingDescription =
aggregatedRatings[capabilityAssessmentId] ||
"No Rating";
const ratingColor =
mapRatingToColor(ratingDescription);
return (
<TableCell
key={capabilityAssessmentId}
style={{
backgroundColor: ratingColor,
fontSize: "0.875rem",
}}
>
{ratingDescription}
</TableCell>
);
})}
</TableRow>
))}
</React.Fragment>
))}
</TableBody>
</Table>
</TableContainer>
</Box>
)}
</Container>
);
};
export default Dashboard;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/pages/Ratings.js
|
import React, { useEffect, useState } from "react";
import {
Box,
Container,
Typography,
MenuItem,
TextField,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
Paper,
IconButton,
Button,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
Snackbar,
Tooltip,
} from "@mui/material";
import { ExpandMore, ExpandLess, Edit } from "@mui/icons-material";
import List from "@mui/material/List";
import ListItem from "@mui/material/ListItem";
import ListItemText from "@mui/material/ListItemText";
import "../App.css";
import {
fetchACCModels,
fetchAttributes,
fetchComponentsByAccModel,
fetchCapabilitiesByComponent,
fetchUserDetails,
fetchRatingOptions,
submitRating,
submitComments,
fetchBulkRatings,
fetchBulkCapabilityAssessmentIDs,
fetchCapabilityAssessment,
} from "../services/ratingsService";
/**
* Component for the ratings page.
*
* This component displays a table of ratings for each capability
* and attribute of the selected ACC model. It also allows the user
* to select a rating and add comments for each capability.
*
* It fetches the ACC models, attributes, components, capabilities,
* capability assessments and rating options from the API and stores them in the state.
*
* When the user selects a rating or adds comments, it saves the selected rating in the state.
*
* When the user submits the ratings, it submits the selected ratings in bulk
* to the API and shows a notification when the ratings are successfully submitted.
*
* If there are any failures while submitting the ratings, it shows an error dialog
* with the details of the failed submissions.
*
* @return {ReactElement} The component for the ratings page.
*/
const Ratings = () => {
const [accModels, setAccModels] = useState([]);
const [selectedAccModel, setSelectedAccModel] = useState("");
const [components, setComponents] = useState([]);
const [capabilities, setCapabilities] = useState([]);
const [expandedComponents, setExpandedComponents] = useState({});
const [attributes, setAttributes] = useState([]);
const [capabilityAssessments, setCapabilityAssessments] = useState({});
const [ratings, setRatings] = useState({});
const [user, setUser] = useState(null);
const [submittedRatings, setSubmittedRatings] = useState({});
const [additionalRatingData, setAdditionalRatingData] = useState({});
const [ratingId, setRatingId] = useState(null);
const [selectedRatings, setSelectedRatings] = useState({});
const [ratingOptions, setRatingOptions] = useState([]);
const [openDialog, setOpenDialog] = useState(false);
const [comments, setComments] = useState("");
const [showSnackbar, setShowSnackbar] = useState(false);
const [snackbarMessage, setSnackbarMessage] = useState("");
const [failureDetails, setFailureDetails] = useState([]);
const [openFailureDialog, setOpenFailureDialog] = useState(false);
/* Fetches the ACC models and attributes when the component mounts. */
useEffect(() => {
const fetchData = async () => {
try {
const accModelsData = await fetchACCModels();
setAccModels(accModelsData);
const attributesData = await fetchAttributes();
setAttributes(attributesData);
} catch (error) {
console.error("Error fetching initial data:", error);
}
};
fetchData();
}, []); // Empty dependency array ensures this runs only once when the component mounts
/*
* Fetches the components associated with the selected ACC model and stores
* them in the components state variable.
*/
useEffect(() => {
if (selectedAccModel) {
const fetchComponentsData = async () => {
try {
const componentsData = await fetchComponentsByAccModel(
selectedAccModel
);
setComponents(componentsData);
} catch (error) {
console.error("Error fetching components:", error);
}
};
fetchComponentsData(); // Runs whenever `selectedAccModel` changes
}
}, [selectedAccModel]);
/**
* Fetches the capabilities for all components in the components state
* variable, mapping each capability to its associated component ID.
* Stores the capabilities in the capabilities state variable.
*/
useEffect(() => {
if (components.length > 0) {
const fetchCapabilitiesData = async () => {
try {
const allCapabilities = await Promise.all(
components.map(async (component) => {
const capabilitiesData = await fetchCapabilitiesByComponent(
component.id
);
return {
componentId: component.id,
capabilities: capabilitiesData,
};
})
);
setCapabilities(allCapabilities);
} catch (error) {
console.error("Error fetching capabilities:", error);
}
};
fetchCapabilitiesData();
}
}, [components]); // Runs whenever `components` changes
/**
* Fetches the user details for the currently authenticated user,
* and stores the result in the `user` state variable.
* If there is no authenticated user, or error fetching the user details,
* logs a console error.
*/
useEffect(() => {
const fetchUserDetailsData = async () => {
try {
// Retrieves auth token from local storage to authenticate the user
const authToken = localStorage.getItem("authToken");
if (!authToken) {
console.error("User is not authenticated");
return;
}
const userData = await fetchUserDetails(authToken);
setUser(userData);
} catch (error) {
console.error("Error fetching user details:", error);
}
};
if (!user) {
fetchUserDetailsData();
}
}, [user]); // Runs when the `user` state changes
/**
* Fetches the capability assessments for the current user, given the capabilities
* and attributes that have been loaded. If either of these are empty, this
* function simply logs a message and does nothing.
*
* The function fetches the capability assessment IDs for the given capability and
* attribute IDs and then maps the assessment data.
*/
useEffect(() => {
const fetchCapabilityAssessmentsData = async () => {
if (capabilities.length > 0 && attributes.length > 0) {
try {
const capabilityIds = capabilities.flatMap((cap) =>
cap.capabilities.map((c) => c.id)
);
const attributeIds = attributes.map((attr) => attr.id);
const assessmentData = await fetchBulkCapabilityAssessmentIDs(
capabilityIds,
attributeIds
);
const assessmentMap = {};
assessmentData.forEach((assessment) => {
const key = `${assessment.capability_id}-${assessment.attribute_id}`;
assessmentMap[key] = assessment.capability_assessment_id; // Save the capability_assessment_id
});
setCapabilityAssessments(assessmentMap);
} catch (error) {
console.error("Error fetching capability assessment data:", error);
}
} else {
console.log("Waiting for capabilities and attributes to be loaded...");
}
};
// Only fetch capability assessments when both capabilities and attributes are loaded
if (capabilities.length > 0 && attributes.length > 0) {
fetchCapabilityAssessmentsData();
}
}, [capabilities, attributes]); // Runs when `capabilities` or `attributes` state changes
/**
* Fetches the ratings data for the current user and capability assessments.
*
* The function checks if the user and capability assessments are loaded. If
* both are loaded, it fetches the ratings data in bulk and populates the
* `ratings` state with the ratings data. It also populates the
* `submittedRatings` and `additionalRatingData` states by mapping the ratings
* data to the capability assessment IDs.
*
* If there is an error while fetching the ratings data, the error is logged to
* the console.
*/
useEffect(() => {
const fetchRatingsData = async () => {
try {
if (user && Object.keys(capabilityAssessments).length > 0) {
const capabilityAssessmentIds = Object.values(capabilityAssessments);
const ratingsData = await fetchBulkRatings(
user,
capabilityAssessmentIds
);
setRatings(ratingsData);
const userSubmittedRatings = {};
const additionalRatingData = {};
Object.values(ratingsData).forEach((rating) => {
const key = `${rating.capability_assessment_id}`;
userSubmittedRatings[key] = rating.rating || "";
additionalRatingData[key] = {
comments: rating.comments || "",
id: rating.id || "",
};
});
console.log("User Submitted Ratings:", userSubmittedRatings);
setSubmittedRatings(userSubmittedRatings);
setAdditionalRatingData(additionalRatingData);
}
} catch (error) {
console.error("Error fetching ratings:", error);
}
};
// Fetch ratings only when the user is set and capability assessments are available
if (user && Object.keys(capabilityAssessments).length > 0) {
fetchRatingsData();
}
}, [user, capabilityAssessments]); // Runs when `user` or `capabilityAssessments` state changes
/**
* Fetches the rating options from the API and sets the fetched options into state
*/
useEffect(() => {
const fetchRatingOptionsData = async () => {
try {
const options = await fetchRatingOptions();
setRatingOptions(options);
} catch (error) {
console.error("Error fetching rating options:", error);
}
};
// Only fetch rating options if they have not been loaded yet
if (!ratingOptions || ratingOptions.length === 0) {
fetchRatingOptionsData(); // Only runs when `ratingOptions` state changes
}
});
/**
* Updates the selected ratings in the state with the newly selected value.
*
* @param {string} capabilityId The ID of the capability
* @param {string} attributeId The ID of the attribute
* @param {string} value The newly selected rating value
*/
const handleRatingChange = (capabilityId, attributeId, value) => {
setSelectedRatings((prev) => ({
...prev,
[`${capabilityId}-${attributeId}`]: value,
}));
};
/**
* Handles expanding or collapsing a component's capability list
* @param {number} componentId - ID of the component to expand or collapse
*/
const handleToggleExpand = (componentId) => {
setExpandedComponents((prevState) => ({
...prevState,
[componentId]: !prevState[componentId],
}));
};
/**
* Handles the edit button click by fetching the latest capability assessment
* data for the given capability and attribute, and then opens the modal dialog
* with the existing rating and comments pre-populated.
* @param {string} capabilityId The ID of the capability
* @param {string} attributeId The ID of the attribute
*/
const handleEditClick = async (capabilityId, attributeId) => {
const assessmentKey = `${capabilityId}-${attributeId}`;
const capabilityAssessmentId = capabilityAssessments[assessmentKey];
if (!capabilityAssessmentId) {
console.error(
`Capability Assessment ID not found for key: ${assessmentKey}`
);
return;
}
try {
const assessmentData = await fetchCapabilityAssessment(
capabilityAssessmentId
);
if (assessmentData && assessmentData.length > 0) {
const latestAssessment = assessmentData[0];
const existingComments = latestAssessment.comments || "";
const ratingId = latestAssessment.id || "";
setComments(existingComments);
setRatingId(ratingId);
setOpenDialog(true);
} else {
console.error(
"No assessment data found for capability assessment ID:",
capabilityAssessmentId
);
}
} catch (error) {
console.error("Error fetching capability assessment data:", error);
}
};
/**
* Handles the submission of the ratings in a batch.
*
* Filters the currently selected ratings to only include the ones that have
* not been previously submitted. Submits each rating in parallel, and shows a
* snackbar with the results. If there are any failures, opens an error dialog
* with the details of the failed submissions.
*/
const handleBatchSubmit = async () => {
try {
const authToken = localStorage.getItem("authToken");
if (!authToken) {
console.error("User is not authenticated");
return;
}
// Filter the selected ratings to only include the ones that have not been previously submitted
const ratingsToSubmit = Object.entries(selectedRatings)
.filter(([key, value]) => value !== submittedRatings[key])
.map(([key, value]) => {
const capabilityAssessmentId = capabilityAssessments[key];
if (!capabilityAssessmentId) {
console.error(`Capability Assessment ID not found for key: ${key}`);
return null;
}
return {
capabilityAssessmentId,
rating: value,
key,
};
})
.filter((entry) => entry !== null);
if (ratingsToSubmit.length === 0) {
console.log("No ratings to submit.");
return;
}
// Submit the ratings in parallel
const results = await Promise.allSettled(
ratingsToSubmit.map(async ({ capabilityAssessmentId, rating, key }) => {
const ratingId = await submitRating(
capabilityAssessmentId,
rating,
authToken
);
// Save the rating ID to the additional rating data
setAdditionalRatingData((prev) => ({
...prev,
[key]: {
...(prev[key] || {}),
id: ratingId,
},
}));
// Return the result with the key and rating ID
return { key, ratingId };
})
);
// Split the results into successful and failed submissions
const successfulSubmissions = results.filter(
(result) => result.status === "fulfilled"
);
const failedSubmissions = results.filter(
(result) => result.status === "rejected"
);
// If there are any failed submissions, open an error dialog with the details
if (failedSubmissions.length > 0) {
console.error("Some ratings failed to submit:", failedSubmissions);
const failureDetails = failedSubmissions.map((failure) => ({
key: failure.reason.key,
reason: failure.reason.message || "Unknown error",
}));
setFailureDetails(failureDetails);
setOpenFailureDialog(true);
}
// If there are any successful submissions, show a success snackbar
if (successfulSubmissions.length > 0) {
console.log(
"Ratings submitted successfully:",
successfulSubmissions.map((r) => r.value)
);
setSubmittedRatings((prev) => ({
...prev,
...selectedRatings,
}));
setSnackbarMessage("Ratings submitted successfully!");
setShowSnackbar(true);
} else {
console.log("No ratings were successfully submitted.");
}
} catch (error) {
console.error("Error submitting ratings:", error);
setSnackbarMessage("Failed to submit ratings.");
setShowSnackbar(true);
}
};
/**
* Saves the comments for a given rating ID.
* @param {string} ratingId - The ID of the rating to save comments for.
* @param {string} comments - The comments to save for the given rating ID.
* @return {Promise} A promise that resolves when the comments have been saved.
*/
const handleSaveComments = async () => {
try {
const authToken = localStorage.getItem("authToken");
if (!authToken) {
console.error("User is not authenticated");
return;
}
if (!ratingId) {
console.error("Rating ID not found");
setSnackbarMessage("Please submit a rating before adding a comment.");
setShowSnackbar(true);
return;
}
await submitComments(ratingId, comments, authToken);
console.log(
`Comments for Rating ID: ${ratingId} submitted successfully!`
);
setOpenDialog(false);
} catch (error) {
console.error("Error submitting comments:", error);
alert("Failed to submit comments.");
setShowSnackbar(true);
}
};
return (
<Container
maxWidth="xl"
classname="custom-container"
>
<Typography
variant="h4"
component="h1"
gutterBottom
sx={{ color: "primary.main" }}
>
Rate Software Capabilities
</Typography>
<Typography
variant="body1"
style={{ marginBottom: "1.5rem", color: "primary.main" }}
>
Rate the effectiveness of each Capability based on its performance. Your
ratings help assess how well each feature meets the intended quality
standards.
<br />
<br />
Select an ACC Model first. Then, expand components to reveal their capabilities.
You can select multiple ratings and click the 'Submit All Ratings' button at the
bottom of the page to save your ratings
</Typography>
<Box display="flex" justifyContent="flex-start" mb={3}>
<TextField
select
label="Select ACC Model"
value={selectedAccModel}
onChange={(e) => setSelectedAccModel(e.target.value)}
variant="outlined"
margin="normal"
sx={{ width: "400px" }}
>
{accModels.map((model) => (
<MenuItem key={model.id} value={model.id}>
{model.name}
</MenuItem>
))}
</TextField>
</Box>
{/* Container for the table that displays the ratings */}
<TableContainer
component={Paper}
style={{ marginTop: "2rem", width: "100%", overflow: "auto", maxHeight: "100vh" }}>
{/* The table that displays the ratings */}
<Table
style={{ border: "1px solid #ddd", tableLayout: "fixed" }}
>
<TableHead>
<TableRow>
{/* The first column which shows the component name */}
<TableCell
style={{
width: "200px", // Fixed width for the first column
fontSize: "1rem",
fontWeight: "bold",
border: "1px solid #ddd",
color: 'primary.main',
backgroundColor: "#E4EFED",
position: "sticky",
left: 0,
zIndex: 3,
}}
>
</TableCell>
{/* Generate table header cells (attribute's name.) */}
{attributes.map((attribute) => (
<TableCell
key={attribute.id}
style={{
width: "180px", // Fixed width for each attribute column
fontSize: "1.25rem",
fontWeight: "bold",
border: "1px solid #ddd",
color: "#2E403B",
backgroundColor: "#E4EFED",
minWidth: "150px", // Ensures each column has a minimum width
overflowWrap: "break-word", // Allow long text to wrap
whiteSpace: "normal", // Prevents long words from overflowing
position: "sticky",
left: 0,
top:0,
zIndex: 2,
}}
>
{attribute.name}
</TableCell>
))}
</TableRow>
</TableHead>
<TableBody>
{/* Generate rows for each component */}
{components.map((component) => (
<React.Fragment key={component.id}>
{/* The first row for the component (with the component name) */}
<TableRow>
<TableCell
style={{
fontSize: "1rem",
border: "1px solid #ddd",
position: "sticky",
left: 0,
zIndex: 1,
backgroundColor: "#E4EFED",
}}
>
<Box display="flex" alignItems="center">
{/* Expand/collapse the component's rows */}
<IconButton
onClick={() => handleToggleExpand(component.id)}
>
{expandedComponents[component.id] ? (
<ExpandLess />
) : (
<ExpandMore />
)}
</IconButton>
{/* The component name */}
<Typography
variant="h6"
component="h2"
style={{ fontSize: "1.125rem", fontWeight: "bold" }}
>
{component.name}
</Typography>
</Box>
</TableCell>
{/* Empty cells for the component's row */}
{attributes.map((attribute) => (
<TableCell
key={`${component.id}-${attribute.id}`}
style={{ border: "1px solid #ddd" }}
></TableCell>
))}
</TableRow>
{/* Generate rows for each capability of the component */}
{expandedComponents[component.id] &&
capabilities
.filter((cap) => cap.componentId === component.id)
.flatMap((cap) => cap.capabilities)
.map((capability) => (
<TableRow key={capability.id}>
{/* The first column with the capability name */}
<TableCell
style={{
paddingLeft: "2rem",
fontSize: "1rem",
border: "1px solid #ddd",
position: "sticky",
left: 0,
zIndex: 3,
backgroundColor: "#E4EFED",
}}
>
{capability.name}
</TableCell>
{/* Generate cells for each attribute of the capability */}
{attributes.map((attribute) => (
<TableCell
key={`${capability.id}-${attribute.id}`}
style={{
border: "1px solid #ddd",
zIndex: 1,
position: "relative",
overflow: "hidden",
}}
>
{/* Container for the rating and edit buttons */}
<Box display="flex" alignItems="center">
{/* Rating dropdown */}
<TextField
select
label="Rate"
value={(() => {
const key = `${capability.id}-${attribute.id}`;
const capabilityAssessmentId =
capabilityAssessments[key];
const selected = selectedRatings[key];
const submitted =
submittedRatings[capabilityAssessmentId];
return selected || submitted || "";
})()}
onChange={(e) =>
handleRatingChange(
capability.id,
attribute.id,
e.target.value
)
}
fullWidth
style={{ fontSize: "0.875rem" }}
>
{/* Generate options for the rating dropdown */}
{ratingOptions.map((option) => (
<MenuItem key={option} value={option}>
{option}
</MenuItem>
))}
</TextField>
{/* Edit button */}
<IconButton
aria-label="edit"
size="small"
onClick={() =>
handleEditClick(capability.id, attribute.id)
}
>
<Tooltip
title={
!selectedRatings[
`${capability.id}-${attribute.id}`
]
? "Submit a rating before adding comments"
: "Add comments"
}
>
<Edit fontSize="small" />
</Tooltip>
</IconButton>
</Box>
</TableCell>
))}
</TableRow>
))}
</React.Fragment>
))}
</TableBody>
</Table>
</TableContainer>
{/* Button to submit all the ratings at once */}
<Button
variant="contained"
color="primary"
style={{ marginTop: "2rem" }}
onClick={handleBatchSubmit}
>
Submit All Ratings
</Button>
{/* Notification for the user when the ratings are successfully submitted */}
<Snackbar
open={showSnackbar}
autoHideDuration={3000}
onClose={() => setShowSnackbar(false)}
message={snackbarMessage}
/>
{/* Dialog for the user to add comments for a rating */}
<Dialog
open={openDialog}
onClose={() => setOpenDialog(false)}
maxWidth="sm"
fullWidth
>
<DialogTitle>Add Comments</DialogTitle>
<DialogContent>
{/* Text field for the comments */}
<TextField
label="Comments"
value={comments}
onChange={(e) => setComments(e.target.value)}
multiline
rows={4}
fullWidth
/>
</DialogContent>
<DialogActions>
{/* Cancel button */}
<Button onClick={() => setOpenDialog(false)} color="secondary">
Cancel
</Button>
{/* Save button */}
<Button onClick={handleSaveComments} color="primary">
Save
</Button>
</DialogActions>
</Dialog>
{/* Dialog to show the user which ratings failed to submit */}
<Dialog
open={openFailureDialog}
onClose={() => setOpenFailureDialog(false)}
maxWidth="sm"
fullWidth
>
<DialogTitle>Submission Failed</DialogTitle>
<DialogContent>
{/* List of failed ratings */}
{failureDetails.length > 0 ? (
<List>
{failureDetails.map((detail, index) => (
<ListItem key={index}>
<ListItemText
primary={`Failed to submit rating for ${detail.key}`}
secondary={detail.reason}
/>
</ListItem>
))}
</List>
) : (
<Typography>No ratings failed to submit.</Typography>
)}
</DialogContent>
<DialogActions>
{/* Close button */}
<Button onClick={() => setOpenFailureDialog(false)} color="primary">
Close
</Button>
</DialogActions>
</Dialog>
</Container>
);
};
export default Ratings;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/loginService.js
|
import axios from "axios";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
export const login = async (username, password) => {
try {
const response = await axios.post(
`${API_BASE_URL}/token`,
new URLSearchParams({
username,
password,
grant_type: "password",
}),
{
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
}
);
return response.data;
} catch (error) {
console.error("Login error:", error);
throw error;
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/userService.js
|
import axios from "axios";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
const getAuthHeaders = () => {
const token = localStorage.getItem("authToken");
if (!token) {
console.error("User is not authenticated");
return {};
}
return {
headers: {
Authorization: `Bearer ${token}`,
},
};
};
export const fetchUsers = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/users`, getAuthHeaders());
return response.data;
} catch (error) {
console.error("Error fetching users:", error);
throw error;
}
};
export const createUser = async (data) => {
try {
const response = await axios.post(
`${API_BASE_URL}/users`,
data,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error creating user:", error);
throw error;
}
};
export const updateUser = async (id, data) => {
try {
const response = await axios.put(
`${API_BASE_URL}/users/${id}`,
data,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error updating user:", error);
throw error;
}
};
export const deleteUser = async (id) => {
try {
await axios.delete(`${API_BASE_URL}/users/${id}`, getAuthHeaders());
} catch (error) {
console.error("Error deleting user:", error);
throw error;
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/componentService.js
|
import axios from "axios";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
const getAuthHeaders = () => {
const token = localStorage.getItem("authToken");
if (!token) {
console.error("User is not authenticated");
return {};
}
return {
headers: {
Authorization: `Bearer ${token}`,
},
};
};
export const fetchACCModels = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/acc-models`);
return response.data;
} catch (error) {
console.error("Error fetching ACC models:", error);
throw error;
}
};
export const fetchComponents = async (accModelId) => {
try {
const response = await axios.get(
`${API_BASE_URL}/components/acc_model/${accModelId}`
);
return response.data;
} catch (error) {
console.error("Error fetching components:", error);
throw error;
}
};
export const createComponent = async (data) => {
try {
const response = await axios.post(
`${API_BASE_URL}/components`,
data,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error creating component:", error);
throw error;
}
};
export const updateComponent = async (id, data) => {
try {
const response = await axios.put(
`${API_BASE_URL}/components/id/${id}`,
data,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error updating component:", error);
throw error;
}
};
export const deleteComponent = async (id) => {
try {
await axios.delete(`${API_BASE_URL}/components/${id}`, getAuthHeaders());
} catch (error) {
console.error("Error deleting component:", error);
throw error;
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/apiService.js
|
import axios from "axios";
import { getAuthHeaders } from "./authService";
const apiClient = axios.create({
baseURL: process.env.REACT_APP_API_BASE_URL,
});
apiClient.interceptors.request.use(
async (config) => {
try {
const headers = await getAuthHeaders();
config.headers = { ...config.headers, ...headers.headers };
return config;
} catch (error) {
console.error("Request interceptor error:", error);
return Promise.reject(error);
}
},
(error) => {
console.error("Request error:", error);
return Promise.reject(error);
}
);
apiClient.interceptors.response.use(
(response) => response,
(error) => {
console.error("Response error:", error);
return Promise.reject(error);
}
);
/**
* Makes an HTTP request to the specified URL with the given options
* and returns the JSON response.
*
* @param {string} url - The URL of the API endpoint to call.
* @param {Object} [options] - The options to pass to the Axios client.
* @returns {Promise<Object>} - The JSON response from the server.
* @throws {Error} - If there is an error with the request.
*/
export const apiRequest = async (url, options) => {
try {
const response = await apiClient(url, options);
return response.data;
} catch (error) {
console.error("API request error:", error);
throw error;
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/ratingsService.js
|
import axios from "axios";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
export const fetchACCModels = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/acc-models`);
return response.data;
} catch (error) {
console.error("Error fetching ACC models:", error);
throw error;
}
};
export const fetchAttributes = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/attributes`);
return response.data;
} catch (error) {
console.error("Error fetching attributes:", error);
throw error;
}
};
export const fetchComponentsByAccModel = async (accModelId) => {
try {
const response = await axios.get(
`${API_BASE_URL}/components/acc_model/${accModelId}`
);
return response.data;
} catch (error) {
console.error("Error fetching components:", error);
throw error;
}
};
export const fetchCapabilitiesByComponent = async (componentId) => {
try {
const response = await axios.get(
`${API_BASE_URL}/capabilities/component/${componentId}`
);
return response.data;
} catch (error) {
console.error("Error fetching capabilities:", error);
throw error;
}
};
export const fetchCapabilityAssessments = async (capabilities, attributes) => {
try {
const assessments = {};
for (const cap of capabilities.flatMap((cap) => cap.capabilities)) {
for (const attr of attributes) {
const params = new URLSearchParams({
capability_id: cap.id,
attribute_id: attr.id,
}).toString();
const response = await axios.get(
`${API_BASE_URL}/capability-assessments/?${params}`
);
assessments[`${cap.id}-${attr.id}`] = response.data;
}
}
return assessments;
} catch (error) {
console.error("Error fetching capability assessments:", error);
throw error;
}
};
export const fetchBulkCapabilityAssessmentIDs = async (capabilityIds, attributeIds) => {
try {
const response = await axios.post(
`${API_BASE_URL}/capability-assessments/bulk/ids`,
{ capability_ids: capabilityIds, attribute_ids: attributeIds }
);
return response.data;
} catch (error) {
console.error("Error fetching capability assessment IDs:", error);
throw error;
}
};
export const fetchUserDetails = async (authToken) => {
try {
const response = await axios.get(`${API_BASE_URL}/users/users/me/`, {
headers: { Authorization: `Bearer ${authToken}` },
});
return response.data;
} catch (error) {
console.error("Error fetching user details:", error);
throw error;
}
};
export const fetchBulkRatings = async (user, capabilityAssessments) => {
try {
const capabilityAssessmentIds = capabilityAssessments;
const response = await axios.post(`${API_BASE_URL}/capability-assessments/ratings/batch/`, capabilityAssessmentIds, {
params: {
user_id: user.id,
},
});
const ratingsData = {};
response.data.forEach(rating => {
ratingsData[rating.capability_assessment_id] = rating;
});
return ratingsData;
} catch (error) {
console.error("Error fetching ratings:", error);
throw error;
}
};
export const fetchRatingOptions = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/rating-options`);
return response.data;
} catch (error) {
console.error("Error fetching rating options:", error);
throw error;
}
};
export const submitRating = async (
capabilityAssessmentId,
ratingValue,
authToken
) => {
try {
const payload = {
capability_assessment_id: capabilityAssessmentId,
rating: ratingValue,
timestamp: new Date().toISOString(),
};
const response = await axios.post(
`${API_BASE_URL}/capability-assessments/${capabilityAssessmentId}/`,
payload,
{
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
}
);
const ratingId = response.data.id;
return ratingId;
} catch (error) {
console.error("Error submitting rating:", error);
}
};
export const submitComments = async (ratingId, comments, authToken) => {
try {
const payload = {
comments: comments,
timestamp: new Date().toISOString(),
};
const response = await axios.put(
`${API_BASE_URL}/capability-assessments/ratings/${ratingId}/`,
payload,
{
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
}
);
} catch (error) {
console.error(
"Error submitting comments:",
error.response ? error.response.data : error.message
);
throw error;
}
};
export const fetchAggregatedRating = async (capabilityAssessmentId) => {
try {
const response = await axios.get(
`${API_BASE_URL}/capability-assessments/${capabilityAssessmentId}/aggregate`
);
return response.data;
} catch (error) {
console.error(
`Error fetching aggregated rating for ${capabilityAssessmentId}:`,
error
);
throw error;
}
};
export const fetchBulkAggregatedRatings = async (capabilityAssessmentIds) => {
try {
const response = await axios.post(
`${API_BASE_URL}/capability-assessments/aggregates`,
capabilityAssessmentIds
);
return response.data;
} catch (error) {
console.error("Error fetching bulk aggregated ratings:", error);
throw error;
}
};
export const submitRatingsBatch = async (ratings, authToken) => {
try {
const response = await axios.post(
`${API_BASE_URL}/capability-assessments/batch/`,
{ ratings },
{
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
}
);
console.log("Batch ratings submitted successfully:", response.data);
return response.data;
} catch (error) {
console.error("Error submitting batch ratings:", error);
throw error;
}
};
export const fetchCapabilityAssessment = async (capabilityAssessmentId) => {
try {
const response = await axios.get(
`${API_BASE_URL}/capability-assessments/${capabilityAssessmentId}`,
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${localStorage.getItem("authToken")}`,
},
}
);
if (response.status === 200) {
return response.data;
} else {
throw new Error(`Failed to fetch data, status code: ${response.status}`);
}
} catch (error) {
console.error("Error fetching capability assessment:", error);
throw error;
}
};
export const fetchHistoricalGraphData = async (capabilityAssessmentIds, startDate, endDate) => {
try {
const response = await axios.post(
`${API_BASE_URL}/capability-assessments/historical-graph-data?start_date=${startDate}&end_date=${endDate}`,
capabilityAssessmentIds
);
return response.data;
} catch (error) {
console.error("Error fetching historical graph data:", error);
throw error;
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/capabilitiesService.js
|
import axios from "axios";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
const getAuthHeaders = () => {
const token = localStorage.getItem("authToken");
if (!token) {
console.error("User is not authenticated");
return {};
}
return {
headers: {
Authorization: `Bearer ${token}`,
},
};
};
export const fetchACCModels = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/acc-models`);
return response.data;
} catch (error) {
console.error("Error fetching ACC models:", error);
throw error;
}
};
export const fetchComponents = async (accModelId) => {
try {
const response = await axios.get(
`${API_BASE_URL}/components/acc_model/${accModelId}`
);
return response.data;
} catch (error) {
console.error("Error fetching components:", error);
throw error;
}
};
export const fetchCapabilities = async (componentId) => {
try {
const response = await axios.get(
`${API_BASE_URL}/capabilities/component/${componentId}`
);
return response.data;
} catch (error) {
console.error("Error fetching capabilities:", error);
throw error;
}
};
export const createCapability = async (data) => {
try {
const response = await axios.post(
`${API_BASE_URL}/capabilities`,
data,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error creating capability:", error);
throw error;
}
};
export const updateCapability = async (id, data) => {
try {
const response = await axios.put(
`${API_BASE_URL}/capabilities/${id}`,
data,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error updating capability:", error);
throw error;
}
};
export const deleteCapability = async (id) => {
try {
await axios.delete(`${API_BASE_URL}/capabilities/${id}`, getAuthHeaders());
} catch (error) {
console.error("Error deleting capability:", error);
throw error;
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/attributeService.js
|
import axios from "axios";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
const getAuthHeaders = () => {
const token = localStorage.getItem("authToken");
if (!token) {
console.error("User is not authenticated");
return {};
}
return {
headers: {
Authorization: `Bearer ${token}`,
},
};
};
export const fetchAttributes = async () => {
try {
const response = await axios.get(
`${API_BASE_URL}/attributes`,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error fetching attributes:", error);
throw error;
}
};
export const createAttribute = async (data) => {
try {
const response = await axios.post(
`${API_BASE_URL}/attributes`,
data,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error creating attribute:", error);
throw error;
}
};
export const updateAttribute = async (id, data) => {
try {
const response = await axios.put(
`${API_BASE_URL}/attributes/${id}`,
data,
getAuthHeaders()
);
return response.data;
} catch (error) {
console.error("Error updating attribute:", error);
throw error;
}
};
export const deleteAttribute = async (id) => {
try {
await axios.delete(`${API_BASE_URL}/attributes/${id}`, getAuthHeaders());
} catch (error) {
console.error("Error deleting attribute:", error);
throw error;
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/registerService.js
|
import axios from "axios";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
export const registerUser = async (userData) => {
try {
const response = await axios.post(`${API_BASE_URL}/users/`, userData);
console.log("Registration response:", response);
return response;
} catch (error) {
console.error("Error during registration:", error);
if (error.response) {
const { status, data } = error.response;
if (status === 422) {
const validationErrors = data.detail || [];
const errorMessage = validationErrors
.map(err => `${err.loc[1]}: ${err.msg}`)
.join(", ");
throw new Error(errorMessage);
}
if (status === 400) {
const errorMessage = data.detail || "A registration error occurred.";
if (errorMessage.includes("User with this username already exists")) {
throw new Error(
"User with this username already exists. Please try a different username."
);
}
if (errorMessage.includes("User with this email already exists")) {
throw new Error(
"User with this email already exists. Please try a different email."
);
}
throw new Error(errorMessage);
} else if (status === 500) {
throw new Error(
"An unexpected error occurred. Please try again later."
);
}
}
throw new Error("An unknown error occurred. Please try again.");
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/authService.js
|
import axios from "axios";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
/**
* Refreshes an access token by making a request to the server with the current
* token. If the refresh is successful, the new access token is stored in
* localStorage and returned. If the refresh fails, an error is thrown.
*
* @returns {Promise<string>} The new access token.
* @throws {Error} If the refresh fails.
*/
export const refreshToken = async () => {
try {
const oldAccessToken = localStorage.getItem("authToken");
if (!oldAccessToken) {
throw new Error("No access token available");
}
const response = await axios.post(`${API_BASE_URL}/refresh-token`, {
access_token: oldAccessToken,
});
const { access_token } = response.data;
localStorage.setItem("authToken", access_token);
return access_token;
} catch (error) {
console.error("Failed to refresh token:", error);
throw error;
}
};
/**
* Returns an object with an Authorization header containing a Bearer token.
* If the token has expired, it will be refreshed using the refreshToken
* function. If the refresh fails, an error is thrown.
*
* @returns {object} An object containing an Authorization header with a
* Bearer token.
* @throws {Error} If the refresh fails.
*/
export const getAuthHeaders = async () => {
const token = localStorage.getItem("authToken");
const tokenExpiry = localStorage.getItem("tokenExpiry");
const currentTime = Date.now();
if (token && tokenExpiry && currentTime < parseInt(tokenExpiry, 10)) {
return {
headers: {
Authorization: `Bearer ${token}`,
},
};
}
try {
const newToken = await refreshToken();
return {
headers: {
Authorization: `Bearer ${newToken}`,
},
};
} catch (error) {
console.error("Unable to refresh token:", error);
throw error;
}
};
export default getAuthHeaders;
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/accModelService.js
|
import axios from "axios";
import getAuthHeaders from "./authService";
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
export const fetchACCModels = async () => {
try {
const headers = await getAuthHeaders();
const response = await axios.get(`${API_BASE_URL}/acc-models`, headers);
return response.data;
} catch (error) {
console.error("Error fetching ACC models:", error);
throw error;
}
};
export const createACCModel = async (data) => {
try {
const headers = await getAuthHeaders();
const response = await axios.post(
`${API_BASE_URL}/acc-models`,
data,
headers
);
return response.data;
} catch (error) {
console.error("Error creating ACC model:", error);
throw error;
}
};
export const updateACCModel = async (id, data) => {
try {
const headers = await getAuthHeaders();
const response = await axios.put(
`${API_BASE_URL}/acc-models/${id}`,
data,
headers
);
return response.data;
} catch (error) {
console.error("Error updating ACC model:", error);
throw error;
}
};
export const deleteACCModel = async (id) => {
try {
const headers = await getAuthHeaders();
await axios.delete(`${API_BASE_URL}/acc-models/${id}`, headers);
} catch (error) {
console.error("Error deleting ACC model:", error);
throw error;
}
};
| 0 |
qxf2_public_repos/acc-model-app/frontend/src
|
qxf2_public_repos/acc-model-app/frontend/src/services/api.js
|
import axios from 'axios';
const api = axios.create({
baseURL: process.env.REACT_APP_API_BASE_URL,
});
export default api;
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/bandit.yml
|
# Skip flagging assert statement inclusion in test during Codacy check
assert_used:
skips: ['*/test_*.py']
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/conftest.py
|
"""
Pytest configuration and shared fixtures
This module contains the common pytest fixtures, hooks, and utility functions
used throughout the test suite. These fixtures help to set up test dependencies
such as browser configurations, base URLs, and
external services (e.g., BrowserStack, SauceLabs, TestRail, Report Portal, etc).
"""
import os
import sys
import glob
import shutil
import pytest
from loguru import logger
from dotenv import load_dotenv
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from conf import browser_os_name_conf # pylint: disable=import-error wrong-import-position
from conf import base_url_conf # pylint: disable=import-error wrong-import-position
from endpoints.api_player import APIPlayer # pylint: disable=import-error wrong-import-position
from page_objects.PageFactory import PageFactory # pylint: disable=import-error wrong-import-position
from utils import interactive_mode # pylint: disable=import-error wrong-import-position
from core_helpers.custom_pytest_plugins import CustomTerminalReporter # pylint: disable=import-error wrong-import-position
load_dotenv()
@pytest.fixture
def test_obj(base_url, browser, browser_version, os_version, os_name, remote_flag, # pylint: disable=redefined-outer-name too-many-arguments too-many-locals
testrail_flag, tesults_flag, test_run_id, remote_project_name, remote_build_name, # pylint: disable=redefined-outer-name
testname, reportportal_service, interactivemode_flag, highlighter_flag, testreporter): # pylint: disable=redefined-outer-name
"Return an instance of Base Page that knows about the third party integrations"
try:
if interactivemode_flag.lower() == "y":
default_flag = interactive_mode.set_default_flag_gui(browser, browser_version,
os_version, os_name, remote_flag, testrail_flag, tesults_flag)
if default_flag is False:
browser,browser_version,remote_flag,os_name,os_version,testrail_flag,tesults_flag =\
interactive_mode.ask_questions_gui(browser,browser_version,os_version,os_name,
remote_flag,testrail_flag,tesults_flag)
test_obj = PageFactory.get_page_object("Zero",base_url=base_url) # pylint: disable=redefined-outer-name
test_obj.set_calling_module(testname)
#Setup and register a driver
test_obj.register_driver(remote_flag, os_name, os_version, browser, browser_version,
remote_project_name, remote_build_name, testname)
#Set highlighter
if highlighter_flag.lower()=='y':
test_obj.turn_on_highlight()
#Setup TestRail reporting
if testrail_flag.lower()=='y':
if test_run_id is None:
test_obj.write('\033[91m'+"\n\nTestRail Integration Exception:"\
" It looks like you are trying to use TestRail Integration without"\
" providing test run id. \nPlease provide a valid test run id along"\
" with test run command using --test_run_id and try again."\
" for eg: pytest --testrail_flag Y --test_run_id 100\n"+'\033[0m')
testrail_flag = 'N'
if test_run_id is not None:
test_obj.register_testrail()
test_obj.set_test_run_id(test_run_id)
if tesults_flag.lower()=='y':
test_obj.register_tesults()
if reportportal_service:
test_obj.set_rp_logger(reportportal_service)
yield test_obj
# Collect the failed scenarios, these scenarios will be printed as table \
# by the pytest's custom testreporter
if test_obj.failed_scenarios:
testreporter.failed_scenarios[testname] = test_obj.failed_scenarios
if os.getenv('REMOTE_BROWSER_PLATFORM') == 'LT' and remote_flag.lower() == 'y':
if test_obj.pass_counter == test_obj.result_counter:
test_obj.execute_javascript("lambda-status=passed")
else:
test_obj.execute_javascript("lambda-status=failed")
elif os.getenv('REMOTE_BROWSER_PLATFORM') == 'BS' and remote_flag.lower() == 'y':
#Upload test logs to BrowserStack
response = upload_test_logs_to_browserstack(test_obj.log_name,test_obj.session_url)
if isinstance(response, dict) and "error" in response:
# Handle the error response returned as a dictionary
test_obj.write(f"Error: {response['error']}",level='error')
if "details" in response:
test_obj.write(f"Details: {response['details']}",level='error')
test_obj.write("Failed to upload log file to BrowserStack",level='error')
else:
# Handle the case where the response is assumed to be a response object
if response.status_code == 200:
test_obj.write("Log file uploaded to BrowserStack session successfully.")
else:
test_obj.write(f"Failed to upload log file. Status code:{response.status_code}",
level='error')
test_obj.write(response.text,level='error')
#Update test run status to respective BrowserStack session
if test_obj.pass_counter == test_obj.result_counter:
test_obj.write("Test Status: PASS")
result_flag = test_obj.execute_javascript("""browserstack_executor:
{"action": "setSessionStatus",
"arguments": {"status":"passed", "reason": "All test cases passed"}}""")
test_obj.conditional_write(result_flag,
positive="Successfully set BrowserStack Test Session Status to PASS",
negative="Failed to set Browserstack session status to PASS")
else:
test_obj.write("Test Status: FAILED",level='error')
result_flag = test_obj.execute_javascript("""browserstack_executor:
{"action": "setSessionStatus","arguments": {"status":"failed",
"reason": "Test failed. Look at terminal logs for more details"}}""")
test_obj.conditional_write(result_flag,
positive="Successfully set BrowserStack Test Session Status to FAILED",
negative="Failed to set Browserstack session status to FAILED")
test_obj.write("*************************")
else:
test_obj.wait(3)
#Teardown
test_obj.teardown()
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Exception when trying to run test:{__file__}")
print(f"Python says:{str(e)}")
if os.getenv('REMOTE_BROWSER_PLATFORM') == 'LT' and remote_flag.lower() == 'y':
test_obj.execute_javascript("lambda-status=error")
elif os.getenv('REMOTE_BROWSER_PLATFORM') == 'BS' and remote_flag.lower() == 'y':
test_obj.execute_javascript("""browserstack_executor: {"action": "setSessionStatus",
"arguments": {"status":"failed", "reason": "Exception occured"}}""")
@pytest.fixture
def test_mobile_obj(mobile_os_name, mobile_os_version, device_name, app_package, app_activity, # pylint: disable=redefined-outer-name too-many-arguments too-many-locals
remote_flag, device_flag, testrail_flag, tesults_flag, test_run_id, app_name, # pylint: disable=redefined-outer-name
app_path, appium_version, interactivemode_flag, testname, remote_project_name, # pylint: disable=redefined-outer-name
remote_build_name, orientation, testreporter): # pylint: disable=redefined-outer-name
"Return an instance of Base Page that knows about the third party integrations"
try:
if interactivemode_flag.lower()=="y":
mobile_os_name, mobile_os_version, device_name, app_package, app_activity, \
remote_flag, device_flag, testrail_flag, tesults_flag, app_name, app_path= \
interactive_mode.ask_questions_mobile(mobile_os_name, mobile_os_version, device_name,
app_package, app_activity, remote_flag, device_flag, testrail_flag,
tesults_flag, app_name, app_path, orientation)
test_mobile_obj = PageFactory.get_page_object("Zero mobile") # pylint: disable=redefined-outer-name
test_mobile_obj.set_calling_module(testname)
#Setup and register a driver
test_mobile_obj.register_driver(mobile_os_name, mobile_os_version, device_name,
app_package, app_activity, remote_flag, device_flag, app_name,
app_path, ud_id,org_id, signing_id, no_reset_flag, appium_version,
remote_project_name, remote_build_name, orientation)
#3. Setup TestRail reporting
if testrail_flag.lower()=='y':
if test_run_id is None:
test_mobile_obj.write('\033[91m'+"\n\nTestRail Integration Exception: "\
"It looks like you are trying to use TestRail Integration "\
"without providing test run id. \nPlease provide a valid test run id "\
"along with test run command using --test_run_id and try again."\
" for eg: pytest --testrail_flag Y --test_run_id 100\n"+'\033[0m')
testrail_flag = 'N'
if test_run_id is not None:
test_mobile_obj.register_testrail()
test_mobile_obj.set_test_run_id(test_run_id)
if tesults_flag.lower()=='y':
test_mobile_obj.register_tesults()
yield test_mobile_obj
# Collect the failed scenarios, these scenarios will be printed as table \
# by the pytest's custom testreporter
if test_mobile_obj.failed_scenarios:
testreporter.failed_scenarios[testname] = test_mobile_obj.failed_scenarios
if os.getenv('REMOTE_BROWSER_PLATFORM') == 'BS' and remote_flag.lower() == 'y':
response = upload_test_logs_to_browserstack(test_mobile_obj.log_name,
test_mobile_obj.session_url,
appium_test = True)
if isinstance(response, dict) and "error" in response:
# Handle the error response returned as a dictionary
test_mobile_obj.write(f"Error: {response['error']}",level='error')
if "details" in response:
test_mobile_obj.write(f"Details: {response['details']}",level='error')
test_mobile_obj.write("Failed to upload log file to BrowserStack",level='error')
else:
# Handle the case where the response is assumed to be a response object
if response.status_code == 200:
test_mobile_obj.write("Log file uploaded to BrowserStack session successfully.")
else:
test_mobile_obj.write("Failed to upload log file. "\
f"Status code: {response.status_code}",level='error')
test_mobile_obj.write(response.text,level='error')
#Update test run status to respective BrowserStack session
if test_mobile_obj.pass_counter == test_mobile_obj.result_counter:
test_mobile_obj.write("Test Status: PASS")
result_flag = test_mobile_obj.execute_javascript("""browserstack_executor:
{"action": "setSessionStatus", "arguments": {"status":"passed",
"reason": "All test cases passed"}}""")
test_mobile_obj.conditional_write(result_flag,
positive="Successfully set BrowserStack Test Session Status to PASS",
negative="Failed to set Browserstack session status to PASS")
else:
test_mobile_obj.write("Test Status: FAILED",level='error')
result_flag = test_mobile_obj.execute_javascript("""browserstack_executor:
{"action": "setSessionStatus", "arguments": {"status":"failed",
"reason": "Test failed. Look at terminal logs for more details"}}""")
test_mobile_obj.conditional_write(result_flag,
positive="Successfully set BrowserStack Test Session Status to FAILED",
negative="Failed to set Browserstack session status to FAILED")
test_mobile_obj.write("*************************")
#Teardown
test_mobile_obj.wait(3)
test_mobile_obj.teardown()
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Exception when trying to run test:{__file__}")
print(f"Python says:{str(e)}")
if os.getenv('REMOTE_BROWSER_PLATFORM') == 'BS' and remote_flag.lower() == 'y':
test_mobile_obj.execute_javascript("""browserstack_executor:
{"action": "setSessionStatus", "arguments":
{"status":"failed", "reason": "Exception occured"}}""")
@pytest.fixture
def test_api_obj(interactivemode_flag, testname, api_url=base_url_conf.api_base_url): # pylint: disable=redefined-outer-name
"Return an instance of Base Page that knows about the third party integrations"
log_file = testname + '.log'
try:
if interactivemode_flag.lower()=='y':
api_url,session_flag = interactive_mode.ask_questions_api(api_url)
test_api_obj = APIPlayer(api_url, # pylint: disable=redefined-outer-name
log_file_path=log_file)
else:
test_api_obj = APIPlayer(url=api_url,
log_file_path=log_file)
yield test_api_obj
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Exception when trying to run test:{__file__}")
print(f"Python says:{str(e)}")
def upload_test_logs_to_browserstack(log_name, session_url, appium_test = False):
"Upload log file to provided BrowserStack session"
try:
from integrations.cross_browsers.BrowserStack_Library import BrowserStack_Library # pylint: disable=import-error,import-outside-toplevel
# Initialize BrowserStack object
browserstack_obj = BrowserStack_Library()
# Build log file path
log_file_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),'log'))
log_file = log_file_dir + os.sep + 'temp_' + log_name
# Check if the log file exists
if not os.path.isfile(log_file):
raise FileNotFoundError(f"Log file '{log_file}' not found.")
# Extract session ID from the provided session URL
session_id = browserstack_obj.extract_session_id(session_url)
if not session_id:
raise ValueError(f"Invalid session URL provided: '{session_url}'")
# Upload the log file to BrowserStack
response = browserstack_obj.upload_terminal_logs(log_file,session_id,appium_test)
return response
except ImportError as e:
return {"error": "Failed to import BrowserStack_Library.", "details": str(e)}
except FileNotFoundError as e:
return {"error": "Log file not found.", "details": str(e)}
except ValueError as e:
return {"error": "Invalid session URL.", "details": str(e)}
except Exception as e: # pylint: disable=broad-exception-caught
# Handle any other unexpected exceptions
return {"error": "An unexpected error occurred while uploading logs"\
" to BrowserStack.", "details": str(e)}
@pytest.fixture
def testname(request):
"pytest fixture for testname"
name_of_test = request.node.name
name_of_test = name_of_test.split('[')[0]
return name_of_test
@pytest.fixture
def testreporter(request):
"pytest summary reporter"
return request.config.pluginmanager.get_plugin("terminalreporter")
@pytest.fixture
def browser(request):
"pytest fixture for browser"
return request.config.getoption("--browser")
@pytest.fixture
def base_url(request):
"pytest fixture for base url"
return request.config.getoption("--app_url")
@pytest.fixture
def api_url(request):
"pytest fixture for base url"
return request.config.getoption("--api_url")
@pytest.fixture
def test_run_id(request):
"pytest fixture for test run id"
return request.config.getoption("--test_run_id")
@pytest.fixture
def testrail_flag(request):
"pytest fixture for test rail flag"
return request.config.getoption("--testrail_flag")
@pytest.fixture
def remote_flag(request):
"pytest fixture for browserstack/sauce flag"
return request.config.getoption("--remote_flag")
@pytest.fixture
def highlighter_flag(request):
"pytest fixture for element highlighter flag"
return request.config.getoption("--highlighter_flag")
@pytest.fixture
def browser_version(request):
"pytest fixture for browser version"
return request.config.getoption("--ver")
@pytest.fixture
def os_name(request):
"pytest fixture for os_name"
return request.config.getoption("--os_name")
@pytest.fixture
def os_version(request):
"pytest fixture for os version"
return request.config.getoption("--os_version")
@pytest.fixture
def remote_project_name(request):
"pytest fixture for browserStack project name"
return request.config.getoption("--remote_project_name")
@pytest.fixture
def remote_build_name(request):
"pytest fixture for browserStack build name"
return request.config.getoption("--remote_build_name")
@pytest.fixture
def slack_flag(request):
"pytest fixture for sending reports on slack"
return request.config.getoption("--slack_flag")
@pytest.fixture
def tesults_flag(request):
"pytest fixture for sending results to tesults"
return request.config.getoption("--tesults")
@pytest.fixture
def mobile_os_name(request):
"pytest fixture for mobile os name"
return request.config.getoption("--mobile_os_name")
@pytest.fixture
def mobile_os_version(request):
"pytest fixture for mobile os version"
return request.config.getoption("--mobile_os_version")
@pytest.fixture
def device_name(request):
"pytest fixture for device name"
return request.config.getoption("--device_name")
@pytest.fixture
def app_package(request):
"pytest fixture for app package"
return request.config.getoption("--app_package")
@pytest.fixture
def app_activity(request):
"pytest fixture for app activity"
return request.config.getoption("--app_activity")
@pytest.fixture
def device_flag(request):
"pytest fixture for device flag"
return request.config.getoption("--device_flag")
@pytest.fixture
def email_pytest_report(request):
"pytest fixture for device flag"
return request.config.getoption("--email_pytest_report")
@pytest.fixture
def app_name(request):
"pytest fixture for app name"
return request.config.getoption("--app_name")
@pytest.fixture
def ud_id(request):
"pytest fixture for iOS udid"
return request.config.getoption("--ud_id")
@pytest.fixture
def org_id(request):
"pytest fixture for iOS team id"
return request.config.getoption("--org_id")
@pytest.fixture
def signing_id(request):
"pytest fixture for iOS signing id"
return request.config.getoption("--signing_id")
@pytest.fixture
def appium_version(request):
"pytest fixture for app name"
return request.config.getoption("--appium_version")
@pytest.fixture
def no_reset_flag(request):
"pytest fixture for no_reset_flag"
return request.config.getoption("--no_reset_flag")
@pytest.fixture
def app_path(request):
"pytest fixture for app path"
return request.config.getoption("--app_path")
@pytest.fixture
def interactivemode_flag(request):
"pytest fixture for questionary module"
return request.config.getoption("--interactive_mode_flag")
@pytest.fixture
def reportportal_service(request):
"pytest service fixture for reportportal"
try:
reportportal_pytest_service = None
if request.config.getoption("--reportportal"):
reportportal_pytest_service = request.node.config.py_test_service
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Exception when trying to run test:{__file__}")
print(f"Python says:{str(e)}")
solution = "It looks like you are trying to use report portal to run your test."\
"\nPlease make sure you have updated .env with the right credentials."
print(f"\033[92m\nSOLUTION: {solution}\n\033[0m")
return reportportal_pytest_service
@pytest.fixture
def summary_flag(request):
"pytest fixture for generating summary using LLM"
return request.config.getoption("--summary")
@pytest.fixture
def orientation(request):
"pytest fixture for device orientation"
return request.config.getoption("--orientation")
def pytest_sessionstart(session):
"""
Perform cleanup at the start of the test session.
Delete the consolidated log file and temporary log files if present.
"""
if not hasattr(session.config, "workerinput"): # Executes during the main session only
source_directory = "log"
log_file_name = "temp_*.log"
consolidated_log_file = os.path.join(source_directory, "consolidated_log.txt")
# Delete the consolidated log file
if os.path.exists(consolidated_log_file):
try:
os.remove(consolidated_log_file)
except OSError as error:
print(f"Error removing existing consolidated log file: {error}")
# Delete all temporary log files if present
for temp_log_file in glob.glob(os.path.join(source_directory, log_file_name)):
try:
os.remove(temp_log_file)
except OSError as error:
print(f"Error removing temporary log file: {error}")
def pytest_sessionfinish(session):
"""
Called after the entire test session finishes.
The temporary log files are consolidated into a single log file
and later deleted.
"""
if not hasattr(session.config, "workerinput"): # Executes during the main session only
source_directory = "log"
log_file_name = "temp_*.log"
consolidated_log_file = os.path.join(source_directory, "consolidated_log.txt")
#Detach all handlers from the logger inorder to release the file handle
#which can be used for deleting the temp files later
logger.remove(None)
#Consolidate the temporary log files into the consolidated log file
try:
with open(consolidated_log_file, "a", encoding="utf-8") as final_log:
for file_name in glob.glob(os.path.join(source_directory, log_file_name)):
source_file = None
try:
with open(file_name, "r", encoding="utf-8") as source_file:
shutil.copyfileobj(source_file, final_log)
os.remove(file_name)
except FileNotFoundError as error:
print(f"Temporary log file not found: {error}")
except Exception as error: # pylint: disable=broad-exception-caught
print(f"Error processing the temporary log file: {error}")
except OSError as error:
print(f"Error processing consolidated log file: {error}")
@pytest.hookimpl(trylast=True)
def pytest_configure(config):
"Sets the launch name based on the marker selected."
browser = config.getoption("browser") # pylint: disable=redefined-outer-name
version = config.getoption("browser_version")
os_name = config.getoption("os_name") # pylint: disable=redefined-outer-name
os_version = config.getoption("os_version") # pylint: disable=redefined-outer-name
# Check if version is specified without a browser
if version and not browser:
raise ValueError("You have specified a browser version without setting a browser." \
"Please use the --browser option to specify the browser.")
if os_version and not os_name:
raise ValueError("You have specified an OS version without setting an OS." \
"Please use the --os_name option to specify the OS.")
default_os_versions = browser_os_name_conf.default_os_versions
# Set default versions for browsers that don't have versions specified
if browser and not version:
version = ["latest"] * len(browser)
if os_name and not os_version:
for os_entry in os_name:
if os_entry.lower() in default_os_versions:
os_version.append(default_os_versions[os_entry.lower()])
else:
raise ValueError(f"No default version available for browser '{os_entry}'."\
" Please specify a version using --ver.")
# Assign back the modified version list to config (in case it was updated)
config.option.browser_version = version
global if_reportportal # pylint: disable=global-variable-undefined
if_reportportal =config.getoption('--reportportal')
# Unregister the old terminalreporter plugin
# Register the custom terminalreporter plugin
if config.pluginmanager.has_plugin("terminalreporter"):
old_reporter = config.pluginmanager.get_plugin("terminalreporter")
config.pluginmanager.unregister(old_reporter, "terminalreporter")
reporter = CustomTerminalReporter(config)
config.pluginmanager.register(reporter, "terminalreporter")
try:
config._inicache["rp_api_key"] = os.getenv('report_portal_api_key') # pylint: disable=protected-access
config._inicache["rp_endpoint"]= os.getenv('report_portal_endpoint') # pylint: disable=protected-access
config._inicache["rp_project"]= os.getenv('report_portal_project') # pylint: disable=protected-access
config._inicache["rp_launch"]= os.getenv('report_portal_launch') # pylint: disable=protected-access
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Exception when trying to run test:{__file__}")
print(f"Python says:{str(e)}")
#Registering custom markers to supress warnings
config.addinivalue_line("markers", "GUI: mark a test as part of the GUI regression suite.")
config.addinivalue_line("markers", "API: mark a test as part of the GUI regression suite.")
config.addinivalue_line("markers", "MOBILE: mark a test as part of the GUI regression suite.")
def pytest_terminal_summary(terminalreporter):
"add additional section in terminal summary reporting."
try:
if not hasattr(terminalreporter.config, 'workerinput'):
if terminalreporter.config.getoption("--slack_flag").lower() == 'y':
from integrations.reporting_channels import post_test_reports_to_slack # pylint: disable=import-error,import-outside-toplevel
post_test_reports_to_slack.post_reports_to_slack()
if terminalreporter.config.getoption("--email_pytest_report").lower() == 'y':
from integrations.reporting_channels.email_pytest_report import EmailPytestReport # pylint: disable=import-error,import-outside-toplevel
#Initialize the Email_Pytest_Report object
email_obj = EmailPytestReport()
# Send html formatted email body message with pytest report as an attachment
email_obj.send_test_report_email(html_body_flag=True,attachment_flag=True,
report_file_path='default')
if terminalreporter.config.getoption("--tesults").lower() == 'y':
from integrations.reporting_tools import Tesults # pylint: disable=import-error,import-outside-toplevel
Tesults.post_results_to_tesults()
if terminalreporter.config.getoption("--summary").lower() == 'y':
from utils import gpt_summary_generator # pylint: disable=import-error,import-outside-toplevel
gpt_summary_generator.generate_gpt_summary()
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Exception when trying to run test:{__file__}")
print(f"Python says:{str(e)}")
solution = "It looks like you are trying to use email pytest report to run your test." \
"\nPlease make sure you have updated .env with the right credentials ."
print(f"\033[92m\nSOLUTION: {solution}\n\033[0m")
def pytest_generate_tests(metafunc):
"test generator function to run tests across different parameters"
try:
if 'browser' in metafunc.fixturenames:
if metafunc.config.getoption("--remote_flag").lower() == 'y':
if metafunc.config.getoption("--browser") == ["all"]:
metafunc.parametrize("browser,browser_version,os_name,os_version",
browser_os_name_conf.cross_browser_cross_platform_config)
elif not metafunc.config.getoption("--browser") or \
not metafunc.config.getoption("--ver") or \
not metafunc.config.getoption("--os_name") or \
not metafunc.config.getoption("--os_version"):
print("Feedback: Missing command-line arguments." \
" Falling back to default values.")
# Use default values from the default list if not provided
default_config_list = browser_os_name_conf.default_config_list
config_list = []
if not metafunc.config.getoption("--browser"):
config_list.append(default_config_list[0][0])
else:
config_list.append(metafunc.config.getoption("--browser")[0])
if not metafunc.config.getoption("--ver"):
config_list.append(default_config_list[0][1])
else:
config_list.append(metafunc.config.getoption("--ver")[0])
if not metafunc.config.getoption("--os_name"):
config_list.append(default_config_list[0][2])
else:
config_list.append(metafunc.config.getoption("--os_name")[0])
if not metafunc.config.getoption("--os_version"):
config_list.append(default_config_list[0][3])
else:
config_list.append(metafunc.config.getoption("--os_version")[0])
metafunc.parametrize("browser, browser_version, os_name, os_version",
[tuple(config_list)])
else:
config_list = [(metafunc.config.getoption("--browser")[0],
metafunc.config.getoption("--ver")[0],
metafunc.config.getoption("--os_name")[0],
metafunc.config.getoption("--os_version")[0])]
metafunc.parametrize("browser,browser_version,os_name,os_version",
config_list)
if metafunc.config.getoption("--remote_flag").lower() !='y':
if metafunc.config.getoption("--browser") == ["all"]:
metafunc.config.option.browser = browser_os_name_conf.local_browsers
metafunc.parametrize("browser", metafunc.config.option.browser)
elif metafunc.config.getoption("--browser") == []:
metafunc.parametrize("browser",browser_os_name_conf.default_browser)
else:
config_list_local = [(metafunc.config.getoption("--browser")[0])]
metafunc.parametrize("browser", config_list_local)
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Exception when trying to run test:{__file__}")
print(f"Python says:{str(e)}")
def pytest_addoption(parser):
"Method to add the option to ini."
try:
parser.addoption("--browser",
dest="browser",
action="append",
default=[],
help="Browser. Valid options are firefox, ie and chrome")
parser.addoption("--app_url",
dest="url",
default=base_url_conf.ui_base_url,
help="The url of the application")
parser.addoption("--api_url",
dest="url",
default="https://cars-app.qxf2.com/",
help="The url of the api")
parser.addoption("--testrail_flag",
dest="testrail_flag",
default='N',
help="Y or N. 'Y' if you want to report to TestRail")
parser.addoption("--test_run_id",
dest="test_run_id",
default=None,
help="The test run id in TestRail")
parser.addoption("--remote_flag",
dest="remote_flag",
default="N",
help="Run the test in Browserstack/Sauce Lab: Y or N")
parser.addoption("--os_version",
dest="os_version",
action="append",
help="The operating system: xp, 7",
default=[])
parser.addoption("--ver",
dest="browser_version",
action="append",
help="The version of the browser: a whole number",
default=[])
parser.addoption("--os_name",
dest="os_name",
action="append",
help="The operating system: Windows 7, Linux",
default=[])
parser.addoption("--remote_project_name",
dest="remote_project_name",
help="The project name if its run in BrowserStack",
default=None)
parser.addoption("--remote_build_name",
dest="remote_build_name",
help="The build name if its run in BrowserStack",
default=None)
parser.addoption("--slack_flag",
dest="slack_flag",
default="N",
help="Post the test report on slack channel: Y or N")
parser.addoption("--mobile_os_name",
dest="mobile_os_name",
help="Enter operating system of mobile. Ex: Android, iOS",
default="Android")
parser.addoption("--mobile_os_version",
dest="mobile_os_version",
help="Enter version of operating system of mobile: 11.0",
default="11.0")
parser.addoption("--device_name",
dest="device_name",
help="Enter device name. Ex: Emulator, physical device name",
default="Samsung Galaxy S21")
parser.addoption("--app_package",
dest="app_package",
help="Enter name of app package. Ex: com.dudam.rohan.bitcoininfo",
default="com.qxf2.weathershopper")
parser.addoption("--app_activity",
dest="app_activity",
help="Enter name of app activity. Ex: .MainActivity",
default=".MainActivity")
parser.addoption("--device_flag",
dest="device_flag",
help="Enter Y or N. 'Y' if you want to run the test on device." \
"'N' if you want to run the test on emulator.",
default="N")
parser.addoption("--email_pytest_report",
dest="email_pytest_report",
help="Email pytest report: Y or N",
default="N")
parser.addoption("--tesults",
dest="tesults_flag",
default='N',
help="Y or N. 'Y' if you want to report results with Tesults")
parser.addoption("--app_name",
dest="app_name",
help="Enter application name to be uploaded." \
"Ex:Bitcoin Info_com.dudam.rohan.bitcoininfo.apk",
default="app-release-v1.2.apk")
parser.addoption("--ud_id",
dest="ud_id",
help="Enter your iOS device UDID which is required" \
"to run appium test in iOS device",
default=None)
parser.addoption("--org_id",
dest="org_id",
help="Enter your iOS Team ID which is required" \
"to run appium test in iOS device",
default=None)
parser.addoption("--signing_id",
dest="signing_id",
help="Enter your iOS app signing id which is required" \
"to run appium test in iOS device",
default="iPhone Developer")
parser.addoption("--no_reset_flag",
dest="no_reset_flag",
help="Pass false if you want to reset app eveytime you run app",
default="true")
parser.addoption("--app_path",
dest="app_path",
help="Enter app path")
parser.addoption("--appium_version",
dest="appium_version",
help="The appium version if its run in BrowserStack",
default="2.4.1")
parser.addoption("--interactive_mode_flag",
dest="questionary",
default="n",
help="set the questionary flag")
parser.addoption("--summary",
dest="summary",
default="n",
help="Generate pytest results summary using LLM (GPT): y or n")
parser.addoption("--orientation",
dest="orientation",
default=None,
help="Enter LANDSCAPE to change device orientation to landscape")
parser.addoption("--highlighter_flag",
dest="highlighter_flag",
default='N',
help="Y or N. 'Y' if you want turn on element highlighter")
except Exception as e: # pylint: disable=broad-exception-caught
print(f"Exception when trying to run test:{__file__}")
print(f"Python says:{str(e)}")
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/pytest.ini
|
[pytest]
addopts = -v -s -rsxX --continue-on-collection-errors --tb=short --ignore=utils/Test_Rail.py --ignore=tests/test_boilerplate.py --ignore=utils/Test_Runner_Class.py -p no:cacheprovider
norecursedirs = .svn _build tmp* log .vscode .git
markers =
GUI: mark a test as part of the GUI regression suite
API: mark a test as part of the API regression suite
MOBILE: mark a test as part of the MOBILE regression suite
ACCESSIBILITY: mark a test as part of the ACCESSIBILITY suite
junit_family=xunit2
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/LICENSE
|
MIT License
Copyright (c) 2016 Qxf2
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/requirements.txt
|
requests==2.32.0
reportportal-client==5.5.4
pytest==8.1.1
selenium==4.12.0
python_dotenv==0.16.0
Appium_Python_Client==3.2.0
pytest-xdist>=1.31
pytest-html>=3.0.0
pytest-rerunfailures>=9.1.1
pytest_reportportal==5.4.0
pillow>=6.2.0
tesults==1.2.1
boto3==1.33.0
loguru
imageio
questionary>=1.9.0
clear-screen>=0.1.14
prompt-toolkit==2.0.10
axe_selenium_python==2.1.6
pytest-snapshot==0.9.0
beautifulsoup4>=4.12.3
openai==1.12.0
pytesseract==0.3.10
pytest-asyncio==0.23.7
prettytable==3.10.2
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/env_remote
|
#Set REMOTE_BROWSER_PLATFROM TO BS TO RUN ON BROWSERSTACK else
#SET REMOTE_BROWSER_PLATFORM TO SL TO RUN ON SAUCELABS
#SET REMOTE_BROWSER_PLATFORM TO LT TO RUN ON LAMBDATEST
REMOTE_BROWSER_PLATFORM = "BS"
REMOTE_USERNAME = "Enter your username"
REMOTE_ACCESS_KEY = "Enter your access key"
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/env_conf
|
# Tesults Configuration
tesults_target_token_default = ""
#TestRail url and credentials
testrail_url = "Add your testrail url"
testrail_user = 'TESTRAIL_USERNAME'
testrail_password = 'TESTRAIL_PASSWORD'
#Details needed for the Gmail
#Fill out the email details over here
imaphost ="imap.gmail.com" #Add imap hostname of your email client
app_username ='USERNAME'
#Login has to use the app password because of Gmail security configuration
# 1. Setup 2 factor authentication
# 2. Follow the 2 factor authentication setup wizard to enable an app password
#Src: https://support.google.com/accounts/answer/185839?hl=en
#Src: https://support.google.com/mail/answer/185833?hl=en
app_password = 'APP_PASSWORD'
#Details for sending pytest report
smtp_ssl_host = 'smtp.gmail.com' # Add smtp ssl host of your email client
smtp_ssl_port = 465 # Add smtp ssl port number of your email client
sender = 'abc@xyz.com' #Add senders email address here
targets = ['asd@xyz.com','qwe@xyz.com'] # Add recipients email address in a list
#REPORT PORTAL
report_portal_api_key = "Enter your report portal api key here"
report_portal_endpoint = "Enter your endpoint here"
report_portal_project = "Enter your Project here"
report_portal_launch = "Enter your project launch here"
#Slack channel incoming webhook
#To generate incoming webhook url ref: https://qxf2.com/blog/post-pytest-test-results-on-slack/
slack_incoming_webhook_url = "Add Slack incomming webhook url here"
# To generate pytest_report.log file add ">pytest_report.log" at end of py.test command
# for e.g. pytest -k example_form --slack_flag y -v > log/pytest_report.log
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/Readme.md
|
## **Run API Tests**
We are using the Qxf2 Page Object Model (POM) framework to run API tests for the ACC Model App. This framework helps in organizing and executing API test cases efficiently by providing a structured approach, reusable components, and easy integration with backend services for testing various API endpoints in the ACC Model App.
- **Run API Tests Locally**
Before running the tests, ensure you have the necessary environment setup, including the Bearer Token for authentication.
- **Run API Tests with Bearer Token**
For authentication, retrieve and export the Bearer Token as an environment variable by following the steps below:
1. **Launch the Backend Service**
Ensure the backend service is running. You can do this by running the application with Docker Compose:
`docker-compose up --build -d`
Confirm the backend is accessible by checking the logs or navigating to the appropriate URL (e.g., http://localhost:8000).
2. **Fetch the Bearer Token**
Use a tool like `curl` to authenticate with the backend and obtain the token. For example:
```bash
curl -X 'POST' \
'http://localhost:8000/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'username=your_username&password=your_password'
```
3. **Set the Token as an Environment Variable**
Use the token from the previous step and export it as an environment variable:
`export bearer_token="your_bearer_token"`
- **Install Test Dependencies**
Navigate to the tests folder and install dependencies using pip:
`cd tests/pip install -r requirements.txt`
- **Run the Tests**
Run specific test files or all tests using pytest. For example, to run a specific test:
`python -m pytest tests/test_name.py`
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/CONTRIBUTING.md
|
Contributing Guidelines
--------
Your contributions are always welcome! There are a number of ways you can contribute. These guidelines instruct how to submit issues and contribute code or documentation to [Qxf2 Automation Framework](https://github.com/qxf2/qxf2-page-object-model).
Reporting bugs
--------
This section guides you through submitting a bug report for Qxf2. Before submitting a new issue, it is always a good idea to check if the same bug or enhancement is already reported. If it is, please add your comments to the existing issue instead of creating a new one.
Bugs are tracked as [GitHub issues](https://github.com/qxf2/qxf2-page-object-model/issues). After you've determined which repository your bug is related to, create an issue on that repository and provide the following information:
* __Use a clear and descriptive title__ for the issue to identify the problem
* __Explain the steps to reproduce__ so that others can understand it and and preferably also reproduce it
* __Provide snippets to demonstrate the steps__ which you might think is causing the bug
* Expected result
* Actual results
* Environment details: Operating system and its version, packages installed
Enhancement requests
--------
Enhancement suggestions are tracked as [GitHub issues](https://github.com/qxf2/qxf2-page-object-model/issues). Enhancements can be anything including completely new features and minor improvements to existing functionality. After you've determined which repository your enhancement suggestion is related to, create an issue on that repository and provide the following information:
* __Use a clear and descriptive title__ for the issue to identify the suggestion.
* __Provide a step-by-step description__ of the suggested enhancement in as many details as possible.
* __Provide specific examples__ to demonstrate the steps.
* __Describe the current behavior__ and __describe which behavior you expected to see instead__ and why.
* __Include screenshots or animated GIF's__ which help you demonstrate the steps or point out the part of framework which the suggestion is related to.
* __Explain how and why this enhancement__ would be useful
* __Specify the name and version of the OS__ you're using.
* __Specify the browser version__ you're using.
* __Describe the new feature and use cases__ for it in as much detail as possible
Code Contributions
--------
This part of the document will guide you through the contribution process. If you have fixed a bug or implemented an enhancement, you can contribute your changes via GitHub's Pull requests. If this is your first time contributing to a project via GitHub follow below guidelines
Here is the basic workflow:
1) Fork the Qxf2 repo. You can do this via the GitHub website. By doing this, you will have a local copy of the qxf2 repo under your Github account.
2) Clone the Qxf2 repo to your local machine
3) Create a feature branch and start hacking
4) Commit the changes on that branch
5) Push your change to your repo
6) Bug fixes and features should have tests. Before you submit your pull request make sure you pass all the tests.
7) Use the github UI to open a PR
8) When code review is complete, a committer will take your PR and merge it on our master branch.
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/tox.ini
|
[tox]
skipsdist = true
[testenv]
#Setting the dependency file
deps = -r{toxinidir}/requirements.txt
#used to not trigger the “not installed in virtualenv” warning message
whitelist_externals=*
#setting the environment
setenv= app_path= {toxinidir}/weather-shopper-app-apk/app/
#Command to run the test
commands = python -m pytest -s -v --app_path {env:app_path} --remote_flag Y -n 3 --remote_project_name Qxf2_Selenium_POM --remote_build_name Selenium_Tutorial --junitxml=test-reports/junit.xml --tb=native --ignore=tests/test_mobile_bitcoin_price.py
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/entrypoint.sh
|
#!/bin/bash
export DISPLAY=:20
Xvfb :20 -screen 0 1366x768x16 &
# Start x11vnc
x11vnc -passwd TestVNC -display :20 -N -forever &
# Run CMD command
exec "$@"
| 0 |
qxf2_public_repos/acc-model-app
|
qxf2_public_repos/acc-model-app/tests/env_ssh_conf
|
#Server credential details needed for ssh
HOST = 'Enter your host details here'
USERNAME = 'USERNAME'
PASSWORD = 'PASSWORD'
PORT = 22
TIMEOUT = 10
#.pem file details
PKEY = 'Enter your key filename here'
#Sample commands to execute(Add your commands here)
COMMANDS = ['ls;mkdir sample']
#Sample file locations to upload and download
UPLOADREMOTEFILEPATH = '/etc/example/filename.txt'
UPLOADLOCALFILEPATH = 'home/filename.txt'
DOWNLOADREMOTEFILEPATH = '/etc/sample/data.txt'
DOWNLOADLOCALFILEPATH = 'home/data.txt'
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/endpoints/api_player.py
|
"""
API_Player class does the following:
a) serves as an interface between the test and API_Interface
b) contains several useful wrappers around commonly used combination of actions
c) maintains the test context/state
"""
import logging
from utils.results import Results
from .api_interface import APIInterface
class APIPlayer(Results):
"The class that maintains the test context/state"
def __init__(self, url, log_file_path=None):
"constructor"
super().__init__(level=logging.DEBUG, log_file_path=log_file_path)
self.api_obj = APIInterface(url=url)
def set_auth_details(self, bearer_token):
"sets the authorization header with the given bearer token"
return f"Bearer {bearer_token}"
def set_header_details(self, auth_details=None):
"make header details"
if auth_details != '' and auth_details is not None:
headers = {'Authorization': f"{auth_details}"}
else:
headers = {'content-type': 'application/json'}
return headers
def create_acc_model(self, acc_details, auth_details=None):
"adds a new ACC model"
data = acc_details
headers = self.set_header_details(auth_details)
json_response = self.api_obj.create_acc_model(data=data, headers=headers)
return json_response
def create_attribute(self, attribute_details, auth_details=None):
"adds a new attribute"
headers = self.set_header_details(auth_details)
response = self.api_obj.create_attribute(data=attribute_details, headers=headers)
return response
# In APIPlayer class
def create_component(self, component_details, auth_details=None):
"Adds a new component"
headers = self.set_header_details(auth_details)
response = self.api_obj.create_component(data=component_details, headers=headers)
return response
def create_capability(self, capability_details, auth_details=None):
"Adds a new capability"
headers = self.set_header_details(auth_details)
response = self.api_obj.create_capability(data=capability_details, headers=headers)
return response
def get_assessment_id(self, capability_id, rating_details, attribute_id, auth_details=None):
"Fetches assessment id"
headers = self.set_header_details(auth_details)
response = self.api_obj.get_assessment_id(
capability_id=capability_id,
attribute_id=attribute_id,
headers=headers)
return response
def submit_ratings(self, assessment_id, rating_details, auth_details=None):
"Adds a new rating with capability_id and attribute_id"
headers = self.set_header_details(auth_details)
response = self.api_obj.submit_ratings(
assessment_id=assessment_id,
data=rating_details,
headers=headers)
return response
def delete_acc_model(self, acc_model_id, auth_details=None):
"Deletes an ACC model"
headers = self.set_header_details(auth_details)
response = self.api_obj.delete_acc_model(acc_model_id=acc_model_id, headers=headers)
return response
def delete_attribute(self, attribute_id, auth_details=None):
"Deletes an attribute"
headers = self.set_header_details(auth_details)
response = self.api_obj.delete_attribute(attribute_id=attribute_id, headers=headers)
return response
def get_user(self, auth_details=None):
"get user"
headers = self.set_header_details(auth_details)
try:
result = self.api_obj.get_user(headers=headers)
self.write(f"Request & Response: {result}")
except (TypeError, AttributeError) as e:
raise e
return {'user_list': result['user_list'], 'response_code': result['response']}
def check_validation_error(self, auth_details=None):
"""
Verify validation error and handle various HTTP response codes (e.g., 403, 401, 200, 404).
"""
# Fetch the response using the get_user method (with optional authentication)
result = self.get_user(auth_details)
response_code = result['response_code']
# Default values for result flag and message
result_flag = False
msg = ''
# Handle different HTTP response codes
if response_code == 403:
msg = "403 FORBIDDEN: Authentication successful but no access for non-admin users"
elif response_code == 200:
result_flag = True
msg = "Successful authentication and access permission"
elif response_code == 401:
msg = "401 UNAUTHORIZED: Authenticate with proper credentials OR Require Basic Authentication"
elif response_code == 404:
msg = "404 NOT FOUND: URL not found"
else:
msg = f"Unknown error code: {response_code}"
# Return the result as a dictionary
return {'result_flag': result_flag, 'msg': msg}
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/endpoints/base_api.py
|
"""
A wrapper around Requests to make Restful API calls
"""
import asyncio
import requests
from requests.exceptions import HTTPError, RequestException
class BaseAPI:
"Main base class for Requests based scripts"
session_object = requests.Session()
base_url = None
def get(self, url, headers=None):
"Get request"
headers = headers if headers else {}
try:
response = self.session_object.get(url=url, headers=headers)
response.raise_for_status()
except HTTPError as http_err:
print(f"GET request failed: {http_err}")
except ConnectionError:
print(f"\033[1;31mFailed to connect to {url}. Check if the API server is up.\033[1;m")
except RequestException as err:
print(f"\033[1;31mAn error occurred: {err}\033[1;m")
return response
# pylint: disable=too-many-arguments
def post(self, url,params=None, data=None,json=None,headers=None):
"Post request"
headers = headers if headers else {}
try:
response = self.session_object.post(url,
params=params,
data=data,
json=json,
headers=headers)
response.raise_for_status()
except HTTPError as http_err:
print(f"POST request failed: {http_err}")
except ConnectionError:
print(f"\033[1;31mFailed to connect to {url}. Check if the API server is up.\033[1;m")
except RequestException as err:
print(f"\033[1;31mAn error occurred: {err}\033[1;m")
return response
def delete(self, url,headers=None):
"Delete request"
headers = headers if headers else {}
try:
response = self.session_object.delete(url, headers=headers)
response.raise_for_status()
except HTTPError as http_err:
print(f"DELETE request failed: {http_err}")
except ConnectionError:
print(f"\033[1;31mFailed to connect to {url}. Check if the API server is up.\033[1;m")
except RequestException as err:
print(f"\033[1;31mAn error occurred: {err}\033[1;m")
return response
def put(self,url,json=None, headers=None):
"Put request"
headers = headers if headers else {}
try:
response = self.session_object.put(url, json=json, headers=headers)
response.raise_for_status()
except HTTPError as http_err:
print(f"PUT request failed: {http_err}")
except ConnectionError:
print(f"\033[1;31mFailed to connect to {url}. Check if the API server is up.\033[1;m")
except RequestException as err:
print(f"\033[1;31mAn error occurred: {err}\033[1;m")
return response
async def async_get(self, url, headers=None):
"Run the blocking GET method in a thread"
headers = headers if headers else {}
response = await asyncio.to_thread(self.get, url, headers)
return response
# pylint: disable=too-many-arguments
async def async_post(self,
url,
params=None,
data=None,
json=None,
headers=None):
"Run the blocking POST method in a thread"
headers = headers if headers else {}
response = await asyncio.to_thread(self.post,
url,
params,
data,
json,
headers)
return response
async def async_delete(self, url, headers=None):
"Run the blocking DELETE method in a thread"
headers = headers if headers else {}
response = await asyncio.to_thread(self.delete, url, headers)
return response
async def async_put(self, url, json=None, headers=None):
"Run the blocking PUT method in a thread"
headers = headers if headers else {}
response = await asyncio.to_thread(self.put, url, json, headers)
return response
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/endpoints/user_api_endpoints.py
|
"""
API endpoints get user information
"""
from .base_api import BaseAPI
class UserAPIEndpoints(BaseAPI):
"Class for user endpoints"
def user_url(self,suffix=''):
"""Append API end point to base URL"""
return self.base_url+'/users/users/me'+suffix
def get_user(self,headers):
"get user"
try:
url = self.user_url('')
json_response = self.get(url,headers=headers)
except Exception as err: # pylint: disable=broad-exception-caught
print(f"Python says: {err}")
json_response = None
return {
'url':url,
'response':json_response.status_code,
'user_list':json_response.json()
}
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/endpoints/api_interface.py
|
"""
A composed Interface for all the Endpoint abstraction objects:
* ACC Model API Endpoints
The APIPlayer Object interacts only to the Interface to access the Endpoint
"""
from .create_acc_model_endpoints import AccAPIEndpoints
from .user_api_endpoints import UserAPIEndpoints
class APIInterface(AccAPIEndpoints,UserAPIEndpoints):
"A composed interface for the API objects"
def __init__(self, url):
"Initialize the Interface"
self.base_url = url
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/endpoints/create_acc_model_endpoints.py
|
"""
API methods for endpoints
"""
from .base_api import BaseAPI
class AccAPIEndpoints(BaseAPI):
"""Class for ACC model endpoints"""
def acc_url(self, suffix=''):
"Append endpoint to base URL"
return self.base_url + suffix
def create_acc_model(self, data, headers):
"Adds a new ACC model"
url = self.acc_url('/acc-models')
response = self.post(url, json=data, headers=headers)
return response
def create_attribute(self, data, headers):
"Adds a new attribute"
url = self.acc_url('/attributes')
response = self.post(url, json=data, headers=headers)
return response
def create_component(self, data, headers):
"Adds a new component"
url = self.acc_url('/components')
response = self.post(url, json=data, headers=headers)
return response
def create_capability(self, data, headers):
"Adds a new capability"
url = self.acc_url('/capabilities')
response = self.post(url, json=data, headers=headers)
return response
def get_assessment_id(self, capability_id, attribute_id, headers):
"Adds a new rating with capability_id and attribute_id"
url = self.acc_url(f'/capability-assessments/?capability_id={capability_id}&attribute_id={attribute_id}')
response = self.get(url, headers=headers)
return response
def submit_ratings(self, assessment_id, data, headers):
"Adds a new rating with assessment_id"
url = self.acc_url(f'/capability-assessments/{assessment_id}')
response = self.post(url, json=data, headers=headers)
return response
def delete_acc_model(self, acc_model_id, headers):
"Deletes an ACC model"
url = self.acc_url(f'/acc-models/{acc_model_id}')
response = self.delete(url, headers=headers)
return response
def delete_attribute(self, attribute_id, headers):
"Deletes an attribute"
url = self.acc_url(f'/attributes/{attribute_id}')
response = self.delete(url, headers=headers)
return response
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/tests/test_end_to_end_api_test.py
|
"""
API automated test for ACC model app
1. Create a new ACC model name
2. Create an attribute
3. Create a component
4. Create a capability
5. Submit ratings
6. Delete newly created ACC model
"""
import os
import sys
import pytest
from conf import api_acc_model_conf as conf
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@pytest.mark.API
def test_api_end_to_end(test_api_obj):
"Run API test for creating an ACC model,attribute,component,capability and submit ratings"
try:
expected_pass = 0
actual_pass = -1
# Set authentication details
bearer_token = conf.bearer_token
acc_details = conf.acc_details
capability_details = conf.capability_details
auth_details = test_api_obj.set_auth_details(bearer_token)
# Create an ACC model
acc_model_response = test_api_obj.create_acc_model(
acc_details=acc_details,
auth_details=auth_details
)
acc_model_result_flag = (
acc_model_response is not None and
acc_model_response.status_code == 200 and
'id' in acc_model_response.json()
)
acc_model_id = acc_model_response.json().get('id') if acc_model_result_flag else None
# Assert if ACC model creation is successful
assert acc_model_result_flag, (
f"Failed to create ACC model. Response: "
f"{acc_model_response.json() if acc_model_response else acc_model_response}"
)
test_api_obj.log_result(
acc_model_result_flag,
positive=f"Successfully created ACC model with details: {acc_model_response.json()}",
negative=(
f"Failed to create ACC model. Response: "
f"{acc_model_response.json() if acc_model_response else acc_model_response}"
)
)
# Create an Attribute
attribute_details = conf.attribute_details
attribute_response = test_api_obj.create_attribute(
attribute_details=attribute_details,
auth_details=auth_details
)
attribute_result_flag = (
attribute_response is not None and
attribute_response.status_code == 200 and
'id' in attribute_response.json()
)
attribute_id = attribute_response.json().get('id') if attribute_result_flag else None
# Assert if Attribute creation is successful
assert attribute_result_flag, (
f"Failed to create attribute. Response: "
f"{attribute_response.json() if attribute_response else attribute_response}"
)
test_api_obj.log_result(
attribute_result_flag,
positive=f"Successfully created attribute with details: {attribute_response.json()}",
negative=(
f"Failed to create attribute with response: "
f"{attribute_response.json() if attribute_response else attribute_response}."
)
)
# Create a Component only if ACC model creation succeeded
if acc_model_result_flag:
component_details = {
'name': conf.components_name,
'description': conf.components_description,
'acc_model_id': acc_model_id
}
component_response = test_api_obj.create_component(
component_details=component_details,
auth_details=auth_details
)
component_result_flag = (
component_response is not None and
component_response.status_code == 200 and
'id' in component_response.json()
)
component_id = component_response.json().get('id') if component_result_flag else None
test_api_obj.log_result(
component_result_flag,
positive=f"Successfully created component with ID: {component_id}",
negative=(
f"Failed to create component with response: "
f"{component_response.json() if component_response else component_response}."
)
)
# Create a Capability dependent on Component ID
if component_result_flag:
capability_details = {
'name': conf.capability_name,
'description': conf.capability_description,
'component_id': component_id
}
capability_response = test_api_obj.create_capability(
capability_details=capability_details,
auth_details=auth_details
)
capability_result_flag = (
capability_response is not None and
capability_response.status_code == 200 and
'id' in capability_response.json()
)
if capability_result_flag:
capability_id = capability_response.json().get('id')
else:
capability_id = None
# Assert if Capability creation is successful
assert capability_result_flag, (
f"Failed to create capability. Response: "
f"{capability_response.json() if capability_response else capability_response}"
)
test_api_obj.log_result(
capability_result_flag,
positive=(
f"Successfully created capability with details: "
f"{capability_response.json()}"
),
negative=(
f"Failed to create capability with response: "
f"{capability_response.json() if capability_response else capability_response}"
)
)
# Submit a Rating for the Capability and Attribute
if capability_result_flag and attribute_result_flag:
# Select a random rating from the predefined list
rating_details = conf.rating_options
# Construct the URL with capability_id and attribute_id
assessment_response = test_api_obj.get_assessment_id(
capability_id=capability_id,
attribute_id=attribute_id,
rating_details=rating_details,
auth_details=auth_details
)
# Log result for rating submission
assessment_id_result_flag = (
assessment_response is not None and
assessment_response.status_code == 200
)
test_api_obj.log_result(
assessment_id_result_flag,
positive=(
f"Successfully retrieved the rating with details: "
f"{assessment_response.json()}"
),
negative=(
f"Failed to retrieve the rating. Response: "
f"{assessment_response.json() if assessment_response else assessment_response}."
)
)
assessment_result_flag = (
assessment_response and assessment_response.status_code == 200
)
assessment_id = (
assessment_response.json().get('id')
if assessment_result_flag
else None
)
test_api_obj.log_result(
assessment_result_flag,
positive=f"Successfully retrieved assessment ID: {assessment_id}",
negative=(
f"Failed to retrieve assessment ID. Response: "
f"{assessment_response.json() if assessment_response else assessment_response}."
)
)
if assessment_result_flag:
rating_payload = {
'capability_assessment_id': assessment_id,
'rating': rating_details,
'comment': 'Retrieving rating details'
}
rating_response = test_api_obj.submit_ratings(
assessment_id=assessment_id,
rating_details=rating_payload,
auth_details=auth_details
)
rating_result_flag = rating_response and rating_response.status_code == 200
test_api_obj.log_result(
rating_result_flag,
positive=f"Successfully submitted rating with details: "
f"{rating_response.json()}",
negative=(
f"Failed to submit rating with response: "
f"{rating_response.json() if rating_response else rating_response}."
)
)
# Delete ACC model
if acc_model_result_flag:
delete_response = test_api_obj.delete_acc_model(
acc_model_id=acc_model_id,
auth_details=auth_details
)
delete_result_flag = (
delete_response is not None and
delete_response.status_code == 200)
# Log result for ACC model deletion
test_api_obj.log_result(
delete_result_flag,
positive=f"Successfully deleted ACC model with ID: {acc_model_id}",
negative=(
f"Failed to delete ACC model. Response: "
f"{delete_response.json() if delete_response else delete_response}."
)
)
# Delete attributes
if attribute_result_flag:
delete_response = test_api_obj.delete_attribute(
attribute_id=attribute_id,
auth_details=auth_details
)
delete_result_flag = (
delete_response is not None and
delete_response.status_code == 200)
# Log result for Attribute deletion
test_api_obj.log_result(
delete_result_flag,
positive=f"Successfully deleted attribute with ID: {attribute_id}",
negative=(
f"Failed to delete attribute. Response: "
f"{delete_response.json() if delete_response else delete_response}."
)
)
# Test for validation http error 401 when no authentication
auth_details = None
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# Test for validation http error 401 for invalid authentication
# Set invalid authentication details
invalid_bearer_token = conf.invalid_bearer_token
auth_details = test_api_obj.set_auth_details(invalid_bearer_token)
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# Update pass/fail counters
expected_pass = test_api_obj.total
actual_pass = test_api_obj.passed
# Write test summary
test_api_obj.write_test_summary()
except TypeError as e:
error_msg = f"TypeError occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
except Exception as e:
# Handle all other exceptions
error_msg = f"Exception occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
# Final assertion
assert expected_pass > 0, f"No checks were executed in the test: {__file__}"
assert expected_pass == actual_pass, f"Test failed: {__file__}"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/tests/test_multiple_acc_models.py
|
"""
API automated test for ACC model app
1. Create new multiple ACC models
2. Delete the newly created ACC models
"""
import os
import sys
import time
import pytest
from conf import api_acc_model_conf as conf
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@pytest.mark.API
def test_multiple_acc_models(test_api_obj):
"""
Run API test for creating multiple ACC models using dynamic names.
"""
try:
# Initialize counters
expected_pass = 0
actual_pass = -1
bearer_token = conf.bearer_token
invalid_bearer_token = conf.invalid_bearer_token
name = conf.acc_models_name
description = conf.acc_models_description
num_models = conf.num_models
# Set valid authentication details
auth_details = test_api_obj.set_auth_details(bearer_token)
created_model_ids = []
# Step 1: Create ACC models with valid token
for counter in range(num_models):
current_timestamp = str(int(time.time()) + counter)
model_name = f"{name}_{current_timestamp}"
acc_details = {
"name": model_name,
"description": description
}
# API call to create ACC model
acc_model_response = test_api_obj.create_acc_model(
acc_details=acc_details,
auth_details=auth_details,
)
# Check creation success
acc_model_result_flag = (
acc_model_response is not None and
acc_model_response.status_code == 200 and
"id" in acc_model_response.json()
)
# Log results
test_api_obj.log_result(
acc_model_result_flag,
positive=f"Successfully created ACC model: {acc_model_response.json()}",
negative=(f"Failed to create ACC model. Response: "
f"{acc_model_response.json() if acc_model_response else acc_model_response}"),
)
# Add model ID to the list for cleanup
if acc_model_result_flag:
created_model_ids.append(acc_model_response.json().get("id"))
else:
raise AssertionError("Failed to create ACC model.")
# Step 2: Delete ACC models with valid token
for acc_model_id in created_model_ids:
delete_response = test_api_obj.delete_acc_model(
acc_model_id,
auth_details=auth_details,
)
# Check deletion success
delete_result_flag = (
delete_response is not None and
delete_response.status_code in (200, 204))
test_api_obj.log_result(
delete_result_flag,
positive=f"Successfully deleted ACC model with ID: {acc_model_id}",
negative=(f"Failed to delete ACC model with ID: {acc_model_id}. "
f"Response: {delete_response.json() if delete_response else delete_response}"),
)
# Test for validation http error 401 when no authentication
auth_details = None
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# Test for validation http error 401 for invalid authentication
invalid_bearer_token = conf.invalid_bearer_token
auth_details = test_api_obj.set_auth_details(invalid_bearer_token)
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# Update pass/fail counters
expected_pass = test_api_obj.total
actual_pass = test_api_obj.passed
# Write test summary
test_api_obj.write_test_summary()
except TypeError as e:
error_msg = f"TypeError occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
except Exception as e:
# Handle all other exceptions
error_msg = f"Exception occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
# Final assertion
assert expected_pass > 0, f"No checks were executed in the test: {__file__}"
assert expected_pass == actual_pass, f"Test failed: {__file__}"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/tests/test_multiple_components.py
|
"""
API automated test for ACC model app
1. Create an ACC model name
2. Create multiple components for each ACC model name
3. Delete an ACC model
"""
import os
import sys
import pytest
from conf import api_acc_model_conf as conf
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@pytest.mark.API
def test_create_and_delete_multiple_components(test_api_obj):
"""
Run API test for creating and deleting multiple components using dynamic names
"""
try:
expected_pass = 0
actual_pass = -1
# Set authentication details
bearer_token = conf.bearer_token
acc_details = conf.acc_details
auth_details = test_api_obj.set_auth_details(bearer_token)
# Create an ACC model
acc_response = test_api_obj.create_acc_model(acc_details=acc_details,
auth_details=auth_details)
acc_result_flag = (
acc_response is not None and
acc_response.status_code==200 and
'id' in acc_response.json())
acc_model_id = acc_response.json().get('id') if acc_result_flag else None
test_api_obj.log_result(
acc_result_flag,
positive=f"Successfully created ACC model: {acc_response.json()}",
negative=(f"Failed to create ACC model. "
f"Response: {acc_response.json() if acc_response else acc_response}")
)
# Fail test if ACC model creation fails
assert acc_model_id, "ACC model creation failed. Cannot proceed with component creation."
# Create multiple Components for the ACC model
component_ids = []
for component in conf.components:
# Add acc_model_id dependency
component_details = {
"name": component["name"],
"description": component["description"],
"acc_model_id": acc_model_id
}
# Create the component
component_response = test_api_obj.create_component(component_details=component_details,
auth_details=auth_details)
component_result_flag = (
component_response is not None and
component_response.status_code == 200 and
'id' in component_response.json())
component_id = component_response.json().get('id') if component_result_flag else None
# Collect successful component IDs
if component_result_flag:
component_ids.append(component_id)
# Log result for each component
test_api_obj.log_result(
component_result_flag,
positive=f"Successfully created component '{component['name']}' with ID: {component_id}",
negative=(f"Failed to create component '{component['name']}'. "
f"Response: {component_response.json() if component_response else component_response}.")
)
# Ensure at least one component is created
assert component_ids, "No components were created successfully."
# Delete ACC model
if acc_result_flag:
delete_response = test_api_obj.delete_acc_model(acc_model_id=acc_model_id,
auth_details=auth_details)
delete_result_flag = (
delete_response is not None and
delete_response.status_code == 200)
test_api_obj.log_result(
delete_result_flag,
positive=f"Successfully deleted ACC model with ID: {acc_model_id}",
negative=(f"Failed to delete ACC model. "
f"Response: {delete_response.json() if delete_response else delete_response}.")
)
# test for validation http error 401 when no authentication
auth_details = None
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# test for validation http error 401 for invalid authentication
# set invalid authentication details
invalid_bearer_token = conf.invalid_bearer_token
auth_details = test_api_obj.set_auth_details(invalid_bearer_token)
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# Update pass/fail counters
expected_pass = test_api_obj.total
actual_pass = test_api_obj.passed
# Write test summary
test_api_obj.write_test_summary()
except TypeError as e:
error_msg = f"TypeError occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
except Exception as e:
# Handle all other exceptions
error_msg = f"Exception occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
# Final assertions
assert expected_pass > 0, f"No checks were executed in the test: {__file__}"
assert expected_pass == actual_pass, f"Test failed: {__file__}"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/tests/test_submit_multiple_ratings.py
|
"""
API automated test for ACC model app
1. Create an ACC model
2. Create multiple attributes
3. Create components for the ACC model
4. Create capabilities for each component
5. Submit ratings for capabilities with different ratings
6. Delete created attributes and an ACC model
"""
import os
import sys
import time
import random
import pytest
from conf import api_acc_model_conf as conf
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@pytest.mark.API
def test_submit_ratings(test_api_obj):
"Run API test for creating an ACC model,attribute,component,capability and submit ratings"
try:
expected_pass = 0
actual_pass = -1
# Set authentication details
bearer_token = conf.bearer_token
auth_details = test_api_obj.set_auth_details(bearer_token)
created_attribute_ids = []
# Create an ACC model
acc_details = conf.acc_details
acc_model_response = test_api_obj.create_acc_model(acc_details=acc_details,
auth_details=auth_details)
acc_model_result_flag = (
acc_model_response is not None and
acc_model_response.status_code == 200 and
'id' in acc_model_response.json())
acc_model_id = acc_model_response.json().get('id') if acc_model_result_flag else None
test_api_obj.log_result(
acc_model_result_flag,
positive=f"Successfully created ACC model with details: {acc_model_response.json()}",
negative=f"Failed to create ACC model. Response: {acc_model_response.json() if acc_model_response else acc_model_response}"
)
# Fail test if ACC model creation fails
assert acc_model_id, "ACC model creation failed. Cannot proceed with the test."
# Create multiple attributes
for counter in range(conf.num_attributes):
current_timestamp = str(int(time.time()) + counter)
attribute_name = f"{conf.attributes_name}_{current_timestamp}"
attribute_description = f"{conf.attributes_description} {counter + 1}"
attribute_details = {
"name": attribute_name,
"description": attribute_description
}
attribute_response = test_api_obj.create_attribute(attribute_details=attribute_details, auth_details=auth_details)
attribute_result_flag = (
attribute_response is not None and
attribute_response.status_code == 200 and
'id' in attribute_response.json()
)
attribute_id = attribute_response.json().get('id') if attribute_result_flag else None
if attribute_result_flag:
created_attribute_ids.append(attribute_id)
test_api_obj.log_result(
attribute_result_flag,
positive=f"Successfully created attribute '{attribute_name}' ID: {attribute_id}",
negative=f"Failed to create attribute '{attribute_name}'. Response: {attribute_response.json() if attribute_response else attribute_response}"
)
# Ensure attributes are created
assert created_attribute_ids, "No attributes were created successfully."
# Create components
component_ids = []
for component in conf.components:
component_details = {
"name": component["name"],
"description": component["description"],
"acc_model_id": acc_model_id
}
component_response = test_api_obj.create_component(component_details=component_details, auth_details=auth_details)
component_result_flag = (
component_response is not None and
component_response.status_code == 200 and
'id' in component_response.json())
component_id = component_response.json().get('id') if component_result_flag else None
if component_result_flag:
component_ids.append(component_id)
test_api_obj.log_result(
component_result_flag,
positive=f"Successfully created component '{component['name']}' ID: {component_id}",
negative=f"Failed to create component '{component['name']}'. Response: {component_response.json() if component_response else component_response}."
)
# Ensure components are created
assert component_ids, "No components were created successfully."
# Create capabilities and submit ratings with different ratings for each capability
for component_id in component_ids:
for capability in conf.multiple_capabilities:
capability_details = {
"name": capability["name"],
"description": capability["description"],
"component_id": component_id
}
capability_response = test_api_obj.create_capability(capability_details=capability_details, auth_details=auth_details)
capability_result_flag = (
capability_response is not None and
capability_response.status_code == 200 and
'id' in capability_response.json())
# Log and validate capability creation response
capability_response_data = capability_response.json()
if isinstance(capability_response_data, dict) and 'id' in capability_response_data:
capability_id = capability_response_data['id']
else:
print(f"Unexpected capability response: {capability_response_data}")
continue
test_api_obj.log_result(
capability_result_flag,
positive=f"Successfully created capability '{capability['name']}' for component ID {component_id} with ID: {capability_id}",
negative=f"Failed to create capability '{capability['name']}' for component ID {component_id}. Response: {capability_response.json() if capability_response else capability_response}."
)
if capability_result_flag:
for attribute_id in created_attribute_ids:
# Explicitly select a random rating for every submission
selected_rating = random.choice(conf.rating_details)
# Retrieve assessment ID
assessment_response = test_api_obj.get_assessment_id(
capability_id=capability_id,
attribute_id=attribute_id,
rating_details=selected_rating, # Send selected rating
auth_details=auth_details
)
# Log and validate assessment response
assessment_response_data = assessment_response.json()
if isinstance(assessment_response_data, dict) and 'id' in assessment_response_data:
assessment_id = assessment_response_data['id']
else:
print(f"Unexpected assessment response: {assessment_response_data}")
continue
test_api_obj.log_result(
assessment_response_data,
positive=f"Successfully retrieved assessment ID: {assessment_id}",
negative=f"Failed to retrieve assessment ID. Response: {assessment_response.json() if assessment_response else assessment_response}."
)
if assessment_response_data:
# Submit Rating
rating_payload = {
'capability_assessment_id': assessment_id,
'rating': selected_rating,
'comment': f'Submitting rating {selected_rating} for attribute {attribute_id} and capability {capability_id}'
}
rating_response = test_api_obj.submit_ratings(
assessment_id=assessment_id,
rating_details=rating_payload,
auth_details=auth_details
)
rating_result = rating_response and rating_response.status_code == 200
test_api_obj.log_result(
rating_result,
positive=f"Successfully submitted rating {selected_rating} with details: {rating_response.json()}",
negative=f"Failed to submit rating with response: {rating_response.json() if rating_response else rating_response}."
)
# Delete all created attributes
unique_attribute_ids = list(set(created_attribute_ids)) # Remove duplicates
for attribute_id in unique_attribute_ids:
try:
delete_response = test_api_obj.delete_attribute(attribute_id,
auth_details=auth_details)
delete_result_flag = (
delete_response is not None and
delete_response.status_code in [200, 204])
test_api_obj.log_result(
delete_result_flag,
positive=f"Successfully deleted attribute with ID: {attribute_id}",
negative=f"Failed to delete attribute with ID: {attribute_id}. Response: {delete_response.json() if delete_response else delete_response}"
)
except Exception as e:
print(f"Error deleting attribute with ID {attribute_id}: {str(e)}")
test_api_obj.log_result(False, negative=f"Exception occurred while deleting attribute ID {attribute_id}: {str(e)}")
# Delete ACC model
if acc_model_result_flag:
delete_response = test_api_obj.delete_acc_model(acc_model_id=acc_model_id,
auth_details=auth_details)
delete_result_flag = (
delete_response is not None and
delete_response.status_code == 200)
test_api_obj.log_result(
delete_result_flag,
positive=f"Successfully deleted ACC model with ID: {acc_model_id}",
negative=f"Failed to delete ACC model. Response: {delete_response.json() if delete_response else delete_response}."
)
# test for validation http error 401 when no authentication
auth_details = None
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# test for validation http error 401 for invalid authentication
# set invalid authentication details
invalid_bearer_token = conf.invalid_bearer_token
auth_details = test_api_obj.set_auth_details(invalid_bearer_token)
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# Update pass/fail counters
expected_pass = test_api_obj.total
actual_pass = test_api_obj.passed
# Write test summary
test_api_obj.write_test_summary()
except TypeError as e:
error_msg = f"TypeError occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
except Exception as e:
# Handle all other exceptions
error_msg = f"Exception occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
# Final assertion
assert expected_pass > 0, f"No checks were executed in the test: {__file__}"
assert expected_pass == actual_pass, f"Test failed: {__file__}"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/tests/test_multiple_attributes.py
|
"""
API automated test for ACC model app
1. Create and delete multiple attributes
"""
import os
import sys
import time
import pytest
from conf import api_acc_model_conf as conf
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@pytest.mark.API
def test_create_and_delete_multiple_attributes(test_api_obj):
"""
Run API test for creating and deleting multiple attributes using dynamic names.
"""
try:
# Initialize pass/fail counters
expected_pass = 0
actual_pass = 0
# Set authentication details
bearer_token = conf.bearer_token
auth_details = test_api_obj.set_auth_details(bearer_token)
name = conf.attributes_name
description = conf.attributes_description
num_attributes = conf.num_attributes
created_attribute_ids = []
# Step 1: Create multiple attributes
for counter in range(num_attributes):
current_timestamp = str(int(time.time()) + counter)
attribute_name = f"{name}_{current_timestamp}"
attribute_details = {
"name": attribute_name,
"description": description
}
# Create an attribute
attribute_response = test_api_obj.create_attribute(
attribute_details=attribute_details,
auth_details=auth_details
)
# Check result of the creation
if attribute_response and attribute_response.status_code == 200:
attribute_result_flag = True
attribute_id = attribute_response.json().get('id')
if attribute_id:
created_attribute_ids.append(attribute_id)
else:
attribute_result_flag = False
# Log result for attribute creation
test_api_obj.log_result(
attribute_result_flag,
positive=(f"Successfully created attribute with details: {attribute_response.json() if attribute_response else ''}"),
negative=(f"Failed to create attribute. Response: {attribute_response.json() if attribute_response else attribute_response}")
)
# Step 2: Delete created attributes
for attribute_id in created_attribute_ids:
try:
delete_response = test_api_obj.delete_attribute(attribute_id,
auth_details=auth_details)
delete_result_flag = (
delete_response is not None and
delete_response.status_code in (200, 204))
# Log result for attribute deletion
test_api_obj.log_result(
delete_result_flag,
positive=f"Successfully deleted attribute with ID: {attribute_id}",
negative=f"Failed to delete attribute with ID: {attribute_id}. Response: {delete_response.json() if delete_response else delete_response}"
)
except Exception as e:
print(f"Error deleting attribute with ID {attribute_id}: {str(e)}")
test_api_obj.log_result(False, negative=f"Exception occurred while deleting attribute ID {attribute_id}: {str(e)}")
# Step 3: Test 401 error validation with no authentication
auth_details = None
result = test_api_obj.check_validation_error(auth_details)
assert not result['result_flag'],"Expected 401 Unauthorized error,but the request succeeded"
test_api_obj.log_result(
not result['result_flag'],
positive=result['msg'],
negative=result['msg']
)
# Step 4: Test 401 error validation with invalid authentication
invalid_bearer_token = conf.invalid_bearer_token
auth_details = test_api_obj.set_auth_details(invalid_bearer_token)
result = test_api_obj.check_validation_error(auth_details)
assert not result['result_flag'],"Expected 401 Unauthorized error,but the request succeeded"
test_api_obj.log_result(
not result['result_flag'],
positive=result['msg'],
negative=result['msg']
)
# Update pass/fail counters
expected_pass = test_api_obj.total
actual_pass = test_api_obj.passed
# Write test summary
test_api_obj.write_test_summary()
except TypeError as e:
error_msg = f"TypeError occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
except Exception as e:
error_msg = f"Exception occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
raise
# Final assertions
assert expected_pass > 0, f"No checks were executed in the test: {__file__}"
assert expected_pass == actual_pass, f"Test failed: {__file__}"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/tests/test_multiple_capabilities.py
|
"""
API automated test for ACC model app
1. Create ACC models
2. Create multiple components
3. Create multiple capabilities
4. Delete all ACC models which were created
"""
import os
import sys
import pytest
from conf import api_acc_model_conf as conf
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@pytest.mark.API
def test_multiple_capabilities(test_api_obj):
"Function to create multiple capabilities for respective components"
try:
expected_pass = 0
actual_pass = -1
# Set authentication details
bearer_token = conf.bearer_token
acc_details = conf.acc_details
auth_details = test_api_obj.set_auth_details(bearer_token)
# Create an ACC model
acc_response = test_api_obj.create_acc_model(acc_details=acc_details,
auth_details=auth_details)
acc_result_flag = (
acc_response is not None and
acc_response.status_code == 200 and
'id' in acc_response.json())
acc_model_id = acc_response.json().get('id') if acc_result_flag else None
test_api_obj.log_result(
acc_result_flag,
positive=f"Successfully created ACC model with details: {acc_response.json()}",
negative=(
f"Failed to create ACC model. Response: "
f"{acc_response.json() if acc_response else acc_response}")
)
# Fail test if ACC model creation fails
assert acc_model_id, "ACC model creation failed. Cannot proceed with component creation."
# Create multiple Components for the ACC model
component_ids = []
for component in conf.components:
# Add acc_model_id dependency
component_details = {
"name": component["name"],
"description": component["description"],
"acc_model_id": acc_model_id
}
# Create the component
component_response = test_api_obj.create_component(component_details=component_details,
auth_details=auth_details)
component_result_flag = (
component_response is not None and
component_response.status_code == 200 and
'id' in component_response.json())
component_id = component_response.json().get('id') if component_result_flag else None
# Collect successful component IDs
if component_result_flag:
component_ids.append(component_id)
# Log result for each component
test_api_obj.log_result(
component_result_flag,
positive=f"Successfully created component '{component['name']}' with ID: {component_id}",
negative=(
f"Failed to create component '{component['name']}'. "
f"Response: {component_response.json() if component_response else component_response}.")
)
# Ensure at least one component is created
assert component_ids, "No components were created successfully."
# Create Capabilities for each Component
for component_id in component_ids:
# Find the component name by matching the component_id
component_name = None
for component in conf.components:
if component["name"] in conf.capabilities:
component_name = component["name"]
break
if component_name:
# Retrieve the list of capabilities for this component
component_capabilities = conf.capabilities.get(component_name, [])
# Initialize the result flag for capabilities creation
capabilities_result = True
# Create capabilities for the current component
for capability in component_capabilities:
capability_details = {
"name": capability["name"],
"description": capability["description"],
"component_id": component_id
}
# Create the capability
capability_response = test_api_obj.create_capability(capability_details=capability_details,
auth_details=auth_details)
capability_result_flag = (
capability_response is not None and
capability_response.status_code == 200)
if capability_result_flag:
# Log the response for debugging
test_api_obj.log_result(
capability_result_flag,
positive=(
f"Successfully created capability '{capability['name']}' for component '{component_name}' "
f"with ID: {capability_response.json()}"
),
negative=(
f"Failed to create capability '{capability['name']}' for component '{component_name}'. "
f"Response: {capability_response.text}")
)
else:
capabilities_result = False
test_api_obj.log_result(
False,
positive="",
negative=(f"Failed to create capability '{capability['name']}' for component '{component_name}'. "
f"Response: {capability_response.text if capability_response else 'No response'}")
)
# If capabilities were not created, raise an assertion error
assert capabilities_result, f"Failed to create capability for component '{component_name}'."
else:
print(f"Component with ID {component_id} does not have defined capabilities.")
# Delete ACC model
if acc_result_flag:
delete_response = test_api_obj.delete_acc_model(acc_model_id=acc_model_id,
auth_details=auth_details)
delete_result_flag = (
delete_response is not None and
delete_response.status_code == 200)
test_api_obj.log_result(
delete_result_flag,
positive=f"Successfully deleted ACC model with ID: {acc_model_id}",
negative=(f"Failed to delete ACC model. "
f"Response: {delete_response.json() if delete_response else delete_response}.")
)
# Test for validation http error 401 when no authentication
auth_details = None
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# Test for validation http error 401 for invalid authentication
# Set invalid authentication details
invalid_bearer_token = conf.invalid_bearer_token
auth_details = test_api_obj.set_auth_details(invalid_bearer_token)
result = test_api_obj.check_validation_error(auth_details)
test_api_obj.log_result(not result['result_flag'],
positive=result['msg'],
negative=result['msg'])
# Update pass/fail counters
expected_pass = test_api_obj.total
actual_pass = test_api_obj.passed
# Write test summary
test_api_obj.write_test_summary()
except TypeError as e:
error_msg = f"TypeError occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
except Exception as e:
# Handle all other exceptions that weren't caught earlier
error_msg = f"Exception occurred in test: {__file__}. Python says: {str(e)}"
print(error_msg)
test_api_obj.write(error_msg)
# Final assertions
assert expected_pass > 0, f"No checks were executed in the test: {__file__}"
assert expected_pass == actual_pass, f"Test failed: {__file__}"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/ssh_util.py
|
"""
Qxf2 Services: Utility script to ssh into a remote server
* Connect to the remote server
* Execute the given command
* Upload a file
* Download a file
"""
import os,sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import socket
import paramiko
from dotenv import load_dotenv
load_dotenv('.env.ssh')
class Ssh_Util:
"Class to connect to remote server"
def __init__(self):
self.ssh_output = None
self.ssh_error = None
self.client = None
self.host= os.getenv('HOST')
self.username = os.getenv('USERNAME')
self.password = os.getenv('PASSWORD')
self.timeout = float(os.getenv('TIMEOUT'))
self.commands = os.getenv('COMMANDS')
self.pkey = os.getenv('PKEY')
self.port = os.getenv('PORT')
self.uploadremotefilepath = os.getenv('UPLOADREMOTEFILEPATH')
self.uploadlocalfilepath = os.getenv('UPLOADLOCALFILEPATH')
self.downloadremotefilepath = os.getenv('DOWNLOADREMOTEFILEPATH')
self.downloadlocalfilepath = os.getenv('DOWNLOADLOCALFILEPATH')
def connect(self):
"Login to the remote server"
try:
#Paramiko.SSHClient can be used to make connections to the remote server and transfer files
print("Establishing ssh connection...")
self.client = paramiko.SSHClient()
#Parsing an instance of the AutoAddPolicy to set_missing_host_key_policy() changes it to allow any host.
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
#Connect to the server
if len(self.password) == 0:
private_key = paramiko.RSAKey.from_private_key_file(self.pkey)
self.client.connect(hostname=self.host, port=self.port, username=self.username,pkey=private_key ,timeout=self.timeout, allow_agent=False, look_for_keys=False)
print("Connected to the server",self.host)
else:
self.client.connect(hostname=self.host, port=self.port,username=self.username,password=self.password,timeout=self.timeout, allow_agent=False, look_for_keys=False)
print("Connected to the server",self.host)
except paramiko.AuthenticationException:
print("Authentication failed, please verify your credentials")
result_flag = False
except paramiko.SSHException as sshException:
print("Could not establish SSH connection: %s" % sshException)
result_flag = False
except socket.timeout as e:
print("Connection timed out")
result_flag = False
except Exception as e:
print('\nException in connecting to the server')
print('PYTHON SAYS:',e)
result_flag = False
self.client.close()
else:
result_flag = True
return result_flag
def execute_command(self,commands):
"""Execute a command on the remote host.Return a tuple containing
an integer status and a two strings, the first containing stdout
and the second containing stderr from the command."""
self.ssh_output = None
result_flag = True
try:
if self.connect():
for command in commands:
print("Executing command --> {}".format(command))
stdout, stderr = self.client.exec_command(command,timeout=10)
self.ssh_output = stdout.read()
self.ssh_error = stderr.read()
if self.ssh_error:
print("Problem occurred while running command:"+ command + " The error is " + self.ssh_error)
result_flag = False
else:
print("Command execution completed successfully",command)
self.client.close()
else:
print("Could not establish SSH connection")
result_flag = False
except socket.timeout as e:
self.write(str(e),'debug')
self.client.close()
result_flag = False
except paramiko.SSHException:
print("Failed to execute the command!",command)
self.client.close()
result_flag = False
return result_flag
def upload_file(self,uploadlocalfilepath,uploadremotefilepath):
"This method uploads the file to remote server"
result_flag = True
try:
if self.connect():
ftp_client= self.client.open_sftp()
ftp_client.put(uploadlocalfilepath,uploadremotefilepath)
ftp_client.close()
self.client.close()
else:
print("Could not establish SSH connection")
result_flag = False
except Exception as e:
print('\nUnable to upload the file to the remote server',uploadremotefilepath)
print('PYTHON SAYS:',e)
result_flag = False
ftp_client.close()
self.client.close()
return result_flag
def download_file(self,downloadremotefilepath,downloadlocalfilepath):
"This method downloads the file from remote server"
result_flag = True
try:
if self.connect():
ftp_client= self.client.open_sftp()
ftp_client.get(downloadremotefilepath,downloadlocalfilepath)
ftp_client.close()
self.client.close()
else:
print("Could not establish SSH connection")
result_flag = False
except Exception as e:
print('\nUnable to download the file from the remote server',downloadremotefilepath)
print('PYTHON SAYS:',e)
result_flag = False
ftp_client.close()
self.client.close()
return result_flag
#---USAGE EXAMPLES
if __name__=='__main__':
try:
print("Start of %s"%__file__)
#Initialize the ssh object
ssh_obj = Ssh_Util()
#Sample code to execute commands
if ssh_obj.execute_command(ssh_obj.commands) is True:
print("Commands executed successfully\n")
else:
print ("Unable to execute the commands" )
#Sample code to upload a file to the server
if ssh_obj.upload_file(ssh_obj.uploadlocalfilepath,ssh_obj.uploadremotefilepath) is True:
print ("File uploaded successfully", ssh_obj.uploadremotefilepath)
else:
print ("Failed to upload the file")
#Sample code to download a file from the server
if ssh_obj.download_file(ssh_obj.downloadremotefilepath,ssh_obj.downloadlocalfilepath) is True:
print ("File downloaded successfully", ssh_obj.downloadlocalfilepath)
else:
print ("Failed to download the file")
except Exception as e:
print('\nKindly rename env_ssh_conf to .env.ssh and provide the credentials\n')
print('PYTHON SAYS:',e)
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/xpath_util.py
|
"""
Qxf2 Services: Utility script to generate XPaths for the given URL
* Take the input URL from the user
* Parse the HTML content using BeautifulSoup
* Find all Input and Button tags
* Guess the XPaths
* Generate Variable names for the xpaths
* To run the script in Gitbash use command 'python -u utils/xpath_util.py'
"""
import re
from selenium import webdriver
from selenium.webdriver.common.by import By
from bs4 import BeautifulSoup
class XpathUtil:
"""Class to generate the xpaths"""
def __init__(self):
"""Initialize the required variables"""
self.elements = None
self.guessable_elements = ['input', 'button']
self.known_attribute_list = ['id', 'name', 'placeholder', 'value', 'title', 'type', 'class']
self.variable_names = []
self.button_text_lists = []
self.language_counter = 1
def guess_xpath(self, tag, attr, element):
"""Guess the xpath based on the tag, attr, element[attr]"""
# Class attribute returned as a unicodeded list, so removing 'u from the list
if isinstance(element[attr], list):
element[attr] = [i.encode('utf-8').decode('latin-1') for i in element[attr]]
element[attr] = ' '.join(element[attr])
xpath = f'//{tag}[@{attr}="{element[attr]}"]'
return xpath
def guess_xpath_button(self, tag, attr, element):
"""Guess the xpath for the button tag"""
button_xpath = f"//{tag}[{attr}='{element}']"
return button_xpath
def guess_xpath_using_contains(self, tag, attr, element):
"""Guess the xpath using contains function"""
button_contains_xpath = f"//{tag}[contains({attr},'{element}')]"
return button_contains_xpath
def generate_xpath_for_element(self, guessable_element, element, driver):
"""Generate xpath for a specific element and assign the variable names"""
result_flag = False
for attr in self.known_attribute_list:
if self.process_attribute(guessable_element, attr, element, driver):
result_flag = True
break
return result_flag
def process_attribute(self, guessable_element, attr, element, driver):
"""Process a specific attribute and generate xpath"""
if element.has_attr(attr):
locator = self.guess_xpath(guessable_element, attr, element)
if len(driver.find_elements(by=By.XPATH, value=locator)) == 1:
variable_name = self.get_variable_names(element)
if variable_name != '' and variable_name not in self.variable_names:
self.variable_names.append(variable_name)
print(f"{guessable_element}_{variable_name.encode('utf-8').decode('latin-1')} ="
f" {locator.encode('utf-8').decode('latin-1')}")
return True
print(f"{locator.encode('utf-8').decode('latin-1')} ----> "
"Couldn't generate an appropriate variable name for this xpath")
elif guessable_element == 'button' and element.get_text():
return self.process_button_text(guessable_element, element, driver)
return False
def process_button_text(self, guessable_element, element, driver):
"""Process button text and generate xpath"""
button_text = element.get_text()
if element.get_text() == button_text.strip():
locator = self.guess_xpath_button(guessable_element, "text()", element.get_text())
else:
locator = self.guess_xpath_using_contains(guessable_element,\
"text()", button_text.strip())
if len(driver.find_elements(by=By.XPATH, value=locator)) == 1:
matches = re.search(r"[^\x00-\x7F]", button_text)
if button_text.lower() not in self.button_text_lists:
self.button_text_lists.append(button_text.lower())
if not matches:
print(f"""{guessable_element}_{button_text.strip()
.strip('!?.').encode('utf-8').decode('latin-1')
.lower().replace(' + ', '_').replace(' & ', '_')
.replace(' ', '_')} = {locator.encode('utf-8').decode('latin-1')}""")
else:
print(f"""{guessable_element}_foreign_language_{self.language_counter} =
{locator.encode('utf-8').decode('latin-1')} --->
Foreign language found, please change the variable name appropriately""")
self.language_counter += 1
else:
print(f"""{locator.encode('utf-8').decode('latin-1')} ---->
Couldn't generate an appropriate variable name for this xpath""")
return True
return False
def generate_xpath_for_elements(self, guessable_element, driver):
"""Generate xpath for a list of elements and assign the variable names"""
result_flag = False
for element in self.elements:
if (not element.has_attr("type")) or \
(element.has_attr("type") and element['type'] != "hidden"):
result_flag |= self.generate_xpath_for_element(guessable_element, element, driver)
return result_flag
def generate_xpath(self, soup, driver):
"""Generate the xpath and assign the variable names"""
result_flag = False
for guessable_element in self.guessable_elements:
self.elements = soup.find_all(guessable_element)
result_flag |= self.generate_xpath_for_elements(guessable_element, driver)
return result_flag
def get_variable_names(self, element):
"""Generate the variable names for the xpath"""
variable_name = ''
if element.has_attr('id') and self.is_valid_id(element['id']):
variable_name = self.extract_id(element)
elif element.has_attr('value') and self.is_valid_value(element['value']):
variable_name = self.extract_value(element)
elif element.has_attr('name') and len(element['name']) > 2:
variable_name = self.extract_name(element)
elif element.has_attr('placeholder') and self.is_valid_placeholder(element['placeholder']):
variable_name = self.extract_placeholder(element)
elif element.has_attr('type') and self.is_valid_type(element['type']):
variable_name = self.extract_type(element)
elif element.has_attr('title'):
variable_name = self.extract_title(element)
elif element.has_attr('role') and element['role'] != "button":
variable_name = self.extract_role(element)
return variable_name
# Helper functions for specific conditions
def is_valid_id(self, id_value):
"""Check if the 'id' attribute is valid for generating a variable name."""
return len(id_value) > 2 and not bool(re.search(r'\d', id_value)) and \
("input" not in id_value.lower() and "button" not in id_value.lower())
def extract_id(self, element):
"""Extract variable name from the 'id' attribute."""
return element['id'].strip("_")
def is_valid_value(self, value):
"""Check if the 'value' attribute is valid for generating a variable name."""
return value != '' and not \
bool(re.search(r'([\d]{1,}([/-]|\s|[.])?)+(\D+)?([/-]|\s|[.])?[[\d]{1,}', value))\
and not bool(re.search(r'\d{1,2}[:]\d{1,2}\s+((am|AM|pm|PM)?)', value))
def extract_value(self, element):
"""Extract variable name from the 'value' attribute."""
if element.has_attr('type') and \
element['type'] in ('radio', 'submit', 'checkbox', 'search'):
return f"{element['type']}_{element.get_text().strip().strip('_.')}"
return element['value'].strip('_.')
def extract_name(self, element):
"""Extract variable name from the 'name' attribute."""
return element['name'].strip("_")
def is_valid_placeholder(self, placeholder):
"""Check if the 'placeholder' attribute is valid for generating a variable name."""
return not bool(re.search(r'\d', placeholder))
def extract_placeholder(self, element):
"""Extract variable name from the 'placeholder' attribute."""
return element['placeholder']
def is_valid_type(self, element_type):
"""Check if the 'type' attribute is valid for generating a variable name."""
return element_type not in ('text', 'button', 'radio', 'checkbox', 'search')
def extract_type(self, element):
"""Extract variable name from the 'type' attribute."""
return element['type']
def extract_title(self, element):
"""Extract variable name from the 'title' attribute."""
return element['title']
def extract_role(self, element):
"""Extract variable name from the 'role' attribute."""
return element['role']
# -------START OF SCRIPT--------
if __name__ == "__main__":
print(f"Start of {__file__}")
# Initialize the xpath object
xpath_obj = XpathUtil()
# Get the URL and parse
url = input("Enter URL: ")
# Create a chrome session
web_driver = webdriver.Chrome()
web_driver.get(url)
# Parsing the HTML page with BeautifulSoup
page = web_driver.execute_script("return document.body.innerHTML")\
.encode('utf-8').decode('latin-1')
soup_parsed = BeautifulSoup(page, 'html.parser')
# execute generate_xpath
if xpath_obj.generate_xpath(soup_parsed, web_driver) is False:
print(f"No XPaths generated for the URL:{url}")
web_driver.quit()
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/results.py
|
"""
Tracks test results and logs them.
Keeps counters of pass/fail/total.
"""
import logging
from utils.Base_Logging import Base_Logging
class Results(object):
""" Base class for logging intermediate test outcomes """
def __init__(self, level=logging.DEBUG, log_file_path=None):
self.logger = Base_Logging(log_file_name=log_file_path, level=level)
self.total = 0 # Increment whenever success or failure are called
self.passed = 0 # Increment everytime success is called
self.written = 0 # Increment when conditional_write is called
# Increment when conditional_write is called with True
self.written_passed = 0
self.failure_message_list = []
def assert_results(self):
""" Check if the test passed or failed """
assert self.passed == self.total
def write(self, msg, level='info'):
""" This method use the logging method """
self.logger.write(msg, level)
def conditional_write(self, condition, positive, negative, level='info', pre_format=" - "):
""" Write out either the positive or the negative message based on flag """
if condition:
self.write(pre_format + positive, level)
self.written_passed += 1
else:
self.write(pre_format + negative, level)
self.written += 1
def log_result(self, flag, positive, negative, level='info'):
""" Write out the result of the test """
if flag is True:
self.success(positive, level=level)
if flag is False:
self.failure(negative, level=level)
raise Exception
self.write('~~~~~~~~\n', level)
def success(self, msg, level='info', pre_format='PASS: '):
""" Write out a success message """
self.logger.write(pre_format + msg, level)
self.total += 1
self.passed += 1
def failure(self, msg, level='info', pre_format='FAIL: '):
""" Write out a failure message """
self.logger.write(pre_format + msg, level)
self.total += 1
self.failure_message_list.append(pre_format + msg)
def get_failure_message_list(self):
""" Return the failure message list """
return self.failure_message_list
def write_test_summary(self):
""" Print out a useful, human readable summary """
self.write('\n************************\n--------RESULT--------\nTotal number of checks=%d' % self.total)
self.write('Total number of checks passed=%d\n----------------------\n************************\n\n' % self.passed)
self.write('Total number of mini-checks=%d' % self.written)
self.write('Total number of mini-checks passed=%d' % self.written_passed)
failure_message_list = self.get_failure_message_list()
if len(failure_message_list) > 0:
self.write('\n--------FAILURE SUMMARY--------\n')
for msg in failure_message_list:
self.write(msg)
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/Image_Compare.py
|
"""
Qxf2 Services: Utility script to compare images
* Compare two images(actual and expected) smartly and generate a resultant image
* Get the sum of colors in an image
"""
from PIL import Image, ImageChops
import math, os
def rmsdiff(im1,im2):
"Calculate the root-mean-square difference between two images"
h = ImageChops.difference(im1, im2).histogram()
# calculate rms
return math.sqrt(sum(h*(i**2) for i, h in enumerate(h)) / (float(im1.size[0]) * im1.size[1]))
def is_equal(img_actual,img_expected,result):
"Returns true if the images are identical(all pixels in the difference image are zero)"
result_flag = False
if not os.path.exists(img_actual):
print('Could not locate the generated image: %s'%img_actual)
if not os.path.exists(img_expected):
print('Could not locate the baseline image: %s'%img_expected)
if os.path.exists(img_actual) and os.path.exists(img_expected):
actual = Image.open(img_actual)
expected = Image.open(img_expected)
result_image = ImageChops.difference(actual,expected)
color_matrix = ([0] + ([255] * 255))
result_image = result_image.convert('L')
result_image = result_image.point(color_matrix)
result_image.save(result)#Save the result image
if (ImageChops.difference(actual,expected).getbbox() is None):
result_flag = True
else:
#Let's do some interesting processing now
result_flag = analyze_difference_smartly(result)
if result_flag is False:
print("Since there is a difference in pixel value of both images, we are checking the threshold value to pass the images with minor difference")
#Now with threshhold!
result_flag = True if rmsdiff(actual,expected) < 958 else False
#For temporary debug purposes
print('RMS diff score: ',rmsdiff(actual,expected))
return result_flag
def analyze_difference_smartly(img):
"Make an evaluation of a difference image"
result_flag = False
if not os.path.exists(img):
print('Could not locate the image to analyze the difference smartly: %s'%img)
else:
my_image = Image.open(img)
#Not an ideal line, but we dont have any enormous images
pixels = list(my_image.getdata())
pixels = [1 for x in pixels if x!=0]
num_different_pixels = sum(pixels)
print('Number of different pixels in the result image: %d'%num_different_pixels)
#Rule 1: If the number of different pixels is <10, then pass the image
#This is relatively safe since all changes to objects will be more than 10 different pixels
if num_different_pixels < 10:
result_flag = True
return result_flag
def get_color_sum(img):
"Get the sum of colors in an image"
sum_color_pixels = -1
if not os.path.exists(img):
print('Could not locate the image to sum the colors: %s'%actual)
else:
my_image = Image.open(img)
color_matrix = ([0] + ([255] * 255))
my_image = my_image.convert('L')
my_image = my_image.point(color_matrix)
#Not an ideal line, but we don't have any enormous images
pixels = list(my_image.getdata())
sum_color_pixels = sum(pixels)
print('Sum of colors in the image %s is %d'%(img,sum_color_pixels))
return sum_color_pixels
#--START OF SCRIPT
if __name__=='__main__':
# Please update below img1, img2, result_img values before running this script
img1 = r'Add path of first image'
img2 = r'Add path of second image'
result_img= r'Add path of result image' #please add path along with resultant image name which you want
# Compare images and generate a resultant difference image
result_flag = is_equal(img1,img2,result_img)
if (result_flag == True):
print("Both images are matching")
else:
print("Images are not matching")
# Get the sum of colors in an image
get_color_sum(img1)
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/stop_test_exception_util.py
|
'''
This utility is for Custom Exceptions.
a) Stop_Test_Exception
You can raise a generic exceptions using just a string.
This is particularly useful when you want to end a test midway based on some condition.
'''
class Stop_Test_Exception(Exception):
def __init__(self,message):
self.message=message
def __str__(self):
return self.message
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/__init__.py
|
"Check if dict item exist for given key else return none"
def get_dict_item(from_this, get_this):
""" get dic object item """
if not from_this:
return None
item = from_this
if isinstance(get_this, str):
if get_this in from_this:
item = from_this[get_this]
else:
item = None
else:
for key in get_this:
if isinstance(item, dict) and key in item:
item = item[key]
else:
return None
return item
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/gpt_summary_generator.py
|
"""
Utility function which is used to summarize the Pytest results using LLM (GPT-4).
And provide recommendations for any failures encountered.
The input for the script is a log file containing the detailed Pytest results.
It then uses the OpenAI API to generate a summary based on the test results.
The summary is written to a html file.
Usage:
python gpt_summary_generator.py
Note:
OPENAI_API_KEY must be provided.
At the time of writing, the model used is "gpt-4-1106-preview".
The prompt used to generate the summary is in conf/gpt_summarization_prompt.py file.
The max_tokens is set to None.
"""
import os
import sys
import json
from openai import OpenAI, OpenAIError
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from conf.gpt_summarization_prompt import summarization_prompt
def get_gpt_response(client, model, results_log_file):
"""
Generate GPT response for summary based on test results.
Args:
- client (OpenAI): The OpenAI client.
- model (str): The GPT model to use.
- results_log_file (str): The file containing the test results.
Returns:
- gpt_response (str): The response generated by the GPT model.
"""
# Example to show how the summary results JSON format should be
example_test_results = {
"SummaryOfTestResults": {
"PassedTests": {
"test_name_1": "{{number_of_checks_passed}}",
"test_name_2": "{{number_of_checks_passed}}"
},
"FailedTests": [
{
"test_name": "test_name_3",
"reasons_for_failure": ["error message 1", "error message 2"],
"recommendations": ["suggestion 1", "suggestion 2"],
},
{
"test_name": "test_name_4",
"reasons_for_failure": ["error message 1", "error message 2"],
"recommendations": ["suggestion 1", "suggestion 2"],
}
# ... Additional failed tests
],
}
}
example_test_results_json = json.dumps(example_test_results)
# Create the system prompt
system_prompt = summarization_prompt + example_test_results_json
# Open the results log file and read its contents
try:
with open(results_log_file, "r") as file:
input_message = file.read()
except FileNotFoundError as file_error:
print(f"Error: Test report file not found - {file_error}")
return None
# Send a request to OpenAI API
try:
response = client.chat.completions.create(
model=model,
response_format={"type": "json_object"},
messages=[
{"role": "system", "content": system_prompt},
{"role": "user", "content": input_message},
],
max_tokens=None,
)
response = response.choices[0].message.content
return response
except OpenAIError as api_error:
print(f"OpenAI API Error: {api_error}")
return None
def generate_html_report(json_string):
"""
Generate an HTML report from a JSON string representing test results.
Args:
- json_string (str): A JSON string representing test results.
Returns:
- html_content (str): An HTML report with the summary of passed and failed tests.
"""
# Load the JSON data
try:
data = json.loads(json_string)
except TypeError as type_error:
print(f"Error loading JSON data: {type_error}")
return None
# Initialize the HTML content
html_content = """
<!DOCTYPE html>
<html>
<head>
<title>Test Results Report</title>
<style>
body { font-family: Arial, sans-serif; }
h2 { color: #333; }
.passed-tests, .failed-tests { margin-bottom: 20px; }
.test-list { list-style-type: none; padding: 0; }
.test-list li { padding: 5px 0; }
.test-list li:before { content: "* "; }
.test-list li.test-name { font-weight: bold; }
.failed-tests table { border-collapse: collapse; width: 100%; }
.failed-tests th, .failed-tests td { border: 1px solid #ddd; padding: 8px; }
.failed-tests th { background-color: #f2f2f2; }
.failed-tests .reasons, .failed-tests .recommendations { list-style-type: disc; margin-left: 20px; }
.heading { color: #000080; }
</style>
</head>
<body>
"""
try:
# Extract and format the summary of test results
summary = data.get("SummaryOfTestResults", {})
passed_tests = summary.get("PassedTests", {})
failed_tests = summary.get("FailedTests", [])
# Passed Tests Section
html_content += "<h2 class='heading'>Passed Tests</h2>"
if passed_tests:
html_content += "<ul class='test-list'>"
for test_name, num_checks_passed in passed_tests.items():
html_content += f"<li class='test-name'>{test_name} ({num_checks_passed} checks)</li>"
html_content += "</ul>"
else:
html_content += "<p>None</p>"
# Failed Tests Section
if failed_tests:
html_content += "<h2 class='heading'>Failed Tests</h2>"
html_content += "<div class='failed-tests'>"
html_content += "<table>"
html_content += "<tr><th>Test Name</th><th>Reasons for Failure</th><th>Recommendations</th></tr>"
for test in failed_tests:
html_content += "<tr>"
html_content += f"<td>{test['test_name']}</td>"
reasons = "<br>".join(
[
f"<li>{reason}</li>"
for reason in test.get("reasons_for_failure", [])
]
)
recommendations = "<br>".join(
[
f"<li>{recommendation}</li>"
for recommendation in test.get("recommendations", [])
]
)
html_content += f"<td><ul class='reasons'>{reasons}</ul></td>"
html_content += (
f"<td><ul class='recommendations'>{recommendations}</ul></td>"
)
html_content += "</tr>"
html_content += "</table>"
html_content += "</div>"
else:
html_content += "<h2 class='heading'>Failed Tests</h2><p>None</p>"
except KeyError as key_error:
print(f"Key error encountered: {key_error}")
return None
# Close the HTML content
html_content += """
</body>
</html>
"""
return html_content
def generate_gpt_summary():
"""
Generate GPT response based on input log file and create a summary HTML report.
"""
# Get the paths of the files
module_path = os.path.dirname(__file__)
test_run_log_file = os.path.abspath(
os.path.join(module_path, "..", "log", "consolidated_log.txt")
)
gpt_summary_file = os.path.abspath(
os.path.join(module_path, "..", "log", "gpt_summary.html")
)
api_key = os.getenv("OPENAI_API_KEY")
client = OpenAI(api_key=api_key)
model = "gpt-4-1106-preview"
# Generate GPT response based on input log file
gpt_response = get_gpt_response(client, model, test_run_log_file)
# Generate HTML report for the GPT response
if gpt_response:
html_report = generate_html_report(gpt_response)
with open(gpt_summary_file, "w") as file:
file.write(html_report)
print(
"\n Results summary generated in gpt_summary.html present under log directory \n"
)
else:
print("Error: No GPT response generated")
# ---USAGE---
if __name__ == "__main__":
generate_gpt_summary()
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/Gif_Maker.py
|
"""
Qxf2 Services: This utility is for creating a GIF of all the screenshots captured during current test run
"""
import imageio.v2 as imageio
import os
def make_gif(screenshot_dir_path,name = "test_recap",suffix=".gif",duration=2):
"Creates gif of the screenshots"
gif_name = None
images = []
if "/" in name:
name=name.split("/")[-1]
filenames = os.listdir(screenshot_dir_path)
if len(filenames) != 0:
gif_name = os.path.join(screenshot_dir_path, name + suffix)
for files in sorted(filenames):
images.append(imageio.imread(os.path.join(screenshot_dir_path, files)))
imageio.mimwrite(gif_name, images, duration=duration)
return gif_name
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/snapshot_util.py
|
"""
Snapshot Integration
* This is a class which extends the methods of Snapshot parent class
"""
import conf.snapshot_dir_conf
from pytest_snapshot.plugin import Snapshot
snapshot_dir = conf.snapshot_dir_conf.snapshot_dir
class Snapshotutil(Snapshot):
"Snapshot object to use snapshot for comparisions"
def __init__(self, snapshot_update=False,
allow_snapshot_deletion=False,
snapshot_dir=snapshot_dir):
super().__init__(snapshot_update, allow_snapshot_deletion, snapshot_dir)
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/Base_Logging.py
|
"""
Qxf2 Services: A plug-n-play class for logging.
This class wraps around Python's loguru module.
"""
import os, inspect
import sys
import logging
from loguru import logger
import re
from reportportal_client import RPLogger, RPLogHandler
class Base_Logging():
"A plug-n-play class for logging"
def __init__(self,log_file_name=None,level="DEBUG"):
"Constructor for the logging class"
logger.remove()
logger.add(sys.stderr,format="<cyan>{time:YYYY-MM-DD HH:mm:ss.SSS}</cyan> | <level>{level: <8}</level> | <level>{message}</level>")
self.log_file_name=log_file_name
self.log_file_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','log'))
self.level=level
self.set_log(self.log_file_name,self.level)
self.rp_logger = None
def set_log(self,log_file_name,level,log_format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}",test_module_name=None):
"Add an handler sending log messages to a sink"
if test_module_name is None:
test_module_name = self.get_calling_module()
if not os.path.exists(self.log_file_dir):
os.makedirs(self.log_file_dir)
if log_file_name is None:
log_file_name = self.log_file_dir + os.sep + test_module_name + '.log'
temp_log_file_name = self.log_file_dir + os.sep + 'temp_' + test_module_name + '.log'
else:
temp_log_file_name = self.log_file_dir + os.sep + 'temp_' + log_file_name
log_file_name = self.log_file_dir + os.sep + log_file_name
logger.add(log_file_name,level=level, format=log_format,
rotation="30 days", filter=None, colorize=None, serialize=False, backtrace=True, enqueue=False, catch=True)
# Create temporary log files for consolidating log data of all tests of a session to a single file
logger.add(temp_log_file_name,level=level, format=log_format,
rotation="30 days", filter=None, colorize=None, serialize=False, backtrace=True, enqueue=False, catch=True)
def get_calling_module(self):
"Get the name of the calling module"
calling_file = inspect.stack()[-1][1]
if 'runpy' in calling_file:
calling_file = inspect.stack()[4][1]
calling_filename = calling_file.split(os.sep)
#This logic bought to you by windows + cygwin + git bash
if len(calling_filename) == 1: #Needed for
calling_filename = calling_file.split('/')
self.calling_module = calling_filename[-1].split('.')[0]
return self.calling_module
def setup_rp_logging(self, rp_pytest_service):
"Setup reportportal logging"
try:
# Setting up a logging.
logging.setLoggerClass(RPLogger)
self.rp_logger = logging.getLogger(__name__)
self.rp_logger.setLevel(logging.INFO)
# Create handler for Report Portal.
rp_handler = RPLogHandler(rp_pytest_service)
# Set INFO level for Report Portal handler.
rp_handler.setLevel(logging.INFO)
return self.rp_logger
except Exception as e:
self.write("Exception when trying to set rplogger")
self.write(str(e))
def write(self,msg,level='info',trace_back=None):
"Write out a message"
all_stack_frames = inspect.stack()
for stack_frame in all_stack_frames[2:]:
if all(helper not in stack_frame[1] for helper in ['web_app_helper', 'mobile_app_helper', 'logging_objects']):
break
module_path = stack_frame[1]
modified_path = module_path.split("qxf2-page-object-model")[-1]
if module_path == modified_path:
modified_path = module_path.split("project")[-1]
fname = stack_frame[3]
d = {'caller_func': fname, 'file_name': modified_path}
if self.rp_logger:
if level.lower()== 'debug':
self.rp_logger.debug(msg=msg)
elif level.lower()== 'info':
self.rp_logger.info(msg)
elif level.lower()== 'success':
self.rp_logger.info(msg)
elif level.lower()== 'warn' or level.lower()=='warning':
self.rp_logger.warning(msg)
elif level.lower()== 'error':
self.rp_logger.error(msg)
elif level.lower()== 'critical':
self.rp_logger.critical(msg)
else:
self.rp_logger.critical(msg)
return
exception_source = self.get_exception_module(trace_back)
file_name = d['file_name']
module = d['caller_func'] if d['caller_func'] != "inner" else exception_source
if level.lower() == 'debug':
logger.opt(colors=True).debug("<cyan>{file_name}</cyan>::<yellow>{module}</yellow> | {msg}", file_name=file_name, module=module, msg=msg)
elif level.lower() == 'info':
logger.opt(colors=True).info("<cyan>{file_name}</cyan>::<yellow>{module}</yellow> | {msg}", file_name=file_name, module=module, msg=msg)
elif level.lower() == 'success':
logger.opt(colors=True).success("<cyan>{file_name}</cyan>::<yellow>{module}</yellow> | {msg}", file_name=file_name, module=module, msg=msg)
elif level.lower() == 'warn' or level.lower() == 'warning':
logger.opt(colors=True).warning("<cyan>{file_name}</cyan>::<yellow>{module}</yellow> | {msg}", file_name=file_name, module=module, msg=msg)
elif level.lower() == 'error':
logger.opt(colors=True).error("<cyan>{file_name}</cyan>::<yellow>{module}</yellow> | {msg}", file_name=file_name, module=module, msg=msg)
elif level.lower() == 'critical':
logger.opt(colors=True).critical("<cyan>{file_name}</cyan>::<yellow>{module}</yellow> | {msg}", file_name=file_name, module=module, msg=msg)
else:
logger.critical("Unknown level passed for the msg: {}", msg)
def get_exception_module(self,trace_back):
"Get the actual name of the calling module where exception arises"
module_name = None
if trace_back is not None:
try:
pattern = r'in (\w+)\n'
# Extracting file name using regular expression
match = re.search(pattern, trace_back)
module_name = match.group(1)
except Exception as e:
self.write("Module where exception arises not found.")
self.write(str(e))
return module_name
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/accessibility_util.py
|
"""
Accessibility Integration
* This is a class which extends the methods of Axe parent class
"""
import os
from axe_selenium_python import Axe
script_url=os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "utils", "axe.min.js"))
class Accessibilityutil(Axe):
"Accessibility object to run accessibility test"
def __init__(self, driver):
super().__init__(driver, script_url)
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/clean_up_repo.py
|
"""
The Qxf2 automation repository ships with example tests.
Run this file to delete all the example files and start fresh with your example.
Usage: python clean_up_repo.py
"""
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from conf import clean_up_repo_conf as conf
from utils.Base_Logging import Base_Logging
class CleanUpRepo:
"""Utility for cleaning up example files."""
def __init__(self):
"""Initializes the CleanUpRepo class with a logger"""
self.logger = Base_Logging(log_file_name="clean_up_repo.log", level="INFO")
def delete_file(self, file_name):
"""The method will delete a particular file"""
if os.path.exists(file_name):
os.remove(file_name)
self.logger.write(f'{file_name} deleted')
def delete_directory(self, dir_name):
"""The method will delete a particular directory along with its content"""
import shutil # pylint: disable=import-error,import-outside-toplevel
if os.path.exists(dir_name) and os.path.isdir(dir_name):
shutil.rmtree(dir_name)
self.logger.write(f'{dir_name} deleted')
def delete_files_in_dir(self, directory, files):
"""The method will delete files in a particular directory"""
for file_name in files:
self.delete_file(os.path.join(directory, file_name))
def delete_files_used_in_example(self):
"""The method will delete a set of files"""
for every_dir_list, every_file_list in zip(conf.dir_list, conf.file_list):
self.delete_files_in_dir(every_dir_list, every_file_list)
def run_cleanup(self):
"""Runs the utility to delete example files and logs the operation."""
self.logger.write("Running utility to delete the files")
self.delete_directory(conf.PAGE_OBJECTS_EXAMPLES_DIR)
self.delete_files_used_in_example()
self.logger.write(
f'All the files related to the sample example from Page Object Model have been removed from {conf.dir_list} folders.\n'
'For next steps, please refer to the edit files section of this blog post: '
'https://qxf2.com/blog/how-to-start-using-the-qxf2-framework-with-a-new-project/'
)
if __name__ == "__main__":
cleanup = CleanUpRepo()
cleanup.run_cleanup()
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/interactive_mode.py
|
"""
Implementing the questionaty library to fetch the users choices for different arguments
"""
import os
import sys
import questionary
from clear_screen import clear
from conf import base_url_conf
from conf import browser_os_name_conf as conf
def display_gui_test_options(browser,browser_version,os_version,
os_name,remote_flag,testrail_flag,tesults_flag):
"Displays the selected options to run the GUI test"
print("Browser selected:",browser)
if browser_version == []:
print("Browser version selected: None")
else:
print("Browser version selected:",browser_version)
if os_name == []:
print("OS selected: None")
else:
print("OS selected:",os_name)
if os_version == []:
print("OS version selected: None")
else:
print("OS version selected:",os_version)
print("Remote flag status:",remote_flag)
print("Testrail flag status:",testrail_flag)
print("Tesults flag status:",tesults_flag)
def set_default_flag_gui(browser,browser_version,os_version,os_name,
remote_flag,testrail_flag,tesults_flag):
"This checks if the user wants to run the test with the default options or no"
questionary.print("\nDefault Options",style="bold fg:green")
questionary.print("**********",style="bold fg:green")
display_gui_test_options(browser,browser_version,os_version,
os_name,remote_flag,testrail_flag,tesults_flag)
questionary.print("**********",style="bold fg:green")
default = questionary.select("Do you want to run the test with the default set of options?",
choices=["Yes","No"]).ask()
default_flag = True if default == "Yes" else False
return default_flag
def get_user_response_gui():
"Get response from user for GUI tests"
response = questionary.select("What would you like to change?",
choices=["Browser","Browser Version","Os Version",
"Os Name","Remote flag status","Testrail flag status",
"Tesults flag status","Set Remote credentials",
"Revert back to default options","Run","Exit"]).ask()
return response
def ask_questions_gui(browser,browser_version,os_version,os_name,remote_flag,
testrail_flag,tesults_flag):
"""This module asks the users questions on what options they wish to run
the test with and stores their choices"""
clear()
while True:
questionary.print("\nUse up and down arrow keys to switch between options.\
\nUse Enter key to select an option",
style="bold fg:yellow")
questionary.print("\nSelected Options",style="bold fg:green")
questionary.print("**********",style="bold fg:green")
display_gui_test_options(browser, browser_version, os_version, os_name,
remote_flag, testrail_flag, tesults_flag)
questionary.print("**********",style="bold fg:green")
response = get_user_response_gui()
clear()
if response == "Browser":
browser=questionary.select("Select the browser",
choices=conf.browsers).ask()
browser_version = []
if remote_flag == "Y":
questionary.print("Please select the browser version",
style="bold fg:darkred")
if response == "Browser Version":
if remote_flag == "Y":
browser_version = get_browser_version(browser)
else:
questionary.print("Browser version can be selected only when running the test remotely.\
\nPlease change the remote flag status inorder to use this option",
style="bold fg:red")
if response == "Remote flag status":
remote_flag = get_remote_flag_status()
if remote_flag == "Y":
browser = "chrome"
os_name = "Windows"
os_version = "10"
browser_version = "65"
questionary.print("The default remote test options has been selected",
style="bold fg:green")
if response == "Os Version":
os_version = get_os_version(os_name)
if response == "Os Name":
if remote_flag == "Y":
os_name, os_version = get_os_name(remote_flag)
else:
questionary.print("OS Name can be selected only when running the test remotely.\
\nPlease change the remote flag status inorder to use this option",
style="bold fg:red")
if response == "Testrail flag status":
testrail_flag = get_testrailflag_status()
if response == "Tesults flag status":
tesults_flag = get_tesultsflag_status()
if response == "Set Remote credentials":
set_remote_credentials()
if response == "Revert back to default options":
browser, os_name, os_version, browser_version, remote_flag, testrail_flag, tesults_flag = gui_default_options()
questionary.print("Reverted back to the default options",style="bold fg:green")
if response == "Run":
if remote_flag == "Y":
if browser_version == []:
questionary.print("Please select the browser version before you run the test",
style="bold fg:darkred")
elif os_version == []:
questionary.print("Please select the OS version before you run the test",
style="bold fg:darkred")
else:
break
else:
break
if response == "Exit":
sys.exit("Program interrupted by user, Exiting the program....")
return browser,browser_version,remote_flag,os_name,os_version,testrail_flag,tesults_flag
def ask_questions_mobile(mobile_os_name, mobile_os_version, device_name, app_package,
app_activity, remote_flag, device_flag, testrail_flag, tesults_flag,
app_name, app_path):
"""This module asks the users questions to fetch the options they wish to run the mobile
test with and stores their choices"""
clear()
while True:
questionary.print("\nUse up and down arrow keys to switch between options.\
\nUse Enter key to select an option",
style="bold fg:yellow")
mobile_display_options(mobile_os_name, mobile_os_version, device_name,
app_package, app_activity, remote_flag, device_flag,
testrail_flag, tesults_flag, app_name, app_path)
questionary.print("**********",style="bold fg:green")
response = get_user_response_mobile()
clear()
if response == "Mobile OS Name":
mobile_os_name, mobile_os_version, device_name = get_mobile_os_name()
if response == "Mobile OS Version":
mobile_os_version = get_mobile_os_version(mobile_os_name)
if response=="Device Name":
if mobile_os_name == "Android":
device_name = mobile_android_devices(mobile_os_version)
if mobile_os_name == "iOS":
device_name = mobile_ios_devices(mobile_os_version)
if response == "App Package":
app_package = questionary.text("Enter the app package name").ask()
if response == "App Activity":
app_package=questionary.text("Enter the App Activity").ask()
if response == "Set Remote credentials":
set_remote_credentials()
if response == "Remote Flag status":
remote_flag = get_remote_flag_status()
if response == "Testrail Flag status":
testrail_flag = get_testrailflag_status()
if response == "Tesults Flag status":
tesults_flag = get_tesultsflag_status()
if response == "App Name":
app_name = questionary.text("Enter App Name").ask()
if response == "App Path":
app_path = questionary.path("Enter the path to your app").ask()
if response == "Revert back to default options":
mobile_os_name, mobile_os_version, device_name, app_package, app_activity, remote_flag, device_flag, testrail_flag,tesults_flag, app_name, app_path = mobile_default_options()
if response == "Run":
if app_path is None:
questionary.print("Please enter the app path before you run the test",
style="bold fg:darkred")
else:
break
if response == "Exit":
sys.exit("Program interrupted by user, Exiting the program....")
return (mobile_os_name, mobile_os_version, device_name, app_package,
app_activity, remote_flag, device_flag, testrail_flag, tesults_flag,
app_name,app_path)
def get_user_response_mobile():
"Get response from user for mobile tests"
response = questionary.select("What would you like to change?",
choices=["Mobile OS Name","Mobile OS Version",
"Device Name","App Package","App Activity",
"Set Remote credentials","Remote Flag status",
"Testrail flag status","Tesults flag status",
"App Name","App Path",
"Revert back to default options",
"Run","Exit"]).ask()
return response
def ask_questions_api(api_url):
"""This module asks the users questions to fetch the options
they wish to run the api test with and stores their choices"""
clear()
while True:
questionary.print("\nSeleted Options",style="bold fg:green")
questionary.print("**********",style="bold fg:green")
print("API URL:",api_url)
questionary.print("**********",style="bold fg:green")
response = get_user_response_api()
clear()
if response == "API URL":
api_url = get_api_url()
if response == "Reset back to default settings":
api_url = base_url_conf.api_base_url
questionary.print("Reverted back to default settings",
style="bold fg:green")
if response == "Run":
break
if response == "Exit":
sys.exit("Program interrupted by user, Exiting the program....")
return api_url
def get_user_response_api():
"Get response from user for api tests"
response=questionary.select("What would you like to change",
choices=["API URL","Session flag status",
"Reset back to default settings",
"Run","Exit"]).ask()
return response
def get_testrailflag_status():
"Get the testrail flag status"
testrail_flag = questionary.select("Enter the testrail flag",
choices=["Yes","No"]).ask()
if testrail_flag == "Yes":
testrail_flag = "Y"
else:
testrail_flag = "N"
return testrail_flag
def get_tesultsflag_status():
"Get tesults flag status"
tesults_flag = questionary.select("Enter the tesults flag",
choices=["Yes","No"]).ask()
if tesults_flag == "Yes":
tesults_flag = "Y"
else:
tesults_flag = "N"
return tesults_flag
def set_remote_credentials():
"set remote credentials file to run the test on browserstack or saucelabs"
platform = questionary.select("Select the remote platform on which you wish to run the test on",
choices=["Browserstack","Saucelabs"]).ask()
if platform == "Browserstack":
platform = "BS"
else:
platform = "SL"
username = questionary.text("Enter the Username").ask()
password = questionary.password("Enter the password").ask()
with open(".env.remote",'w') as cred_file:
cred_file.write("REMOTE_BROWSER_PLATFORM = '%s'\
\nREMOTE_USERNAME = '%s'\
\nREMOTE_ACCESS_KEY = '%s'"%(platform,username,password))
questionary.print("Updated the credentials successfully",
style="bold fg:green")
def get_remote_flag_status():
"Get the remote flag status"
remote_flag = questionary.select("Select the remote flag status",
choices=["Yes","No"]).ask()
if remote_flag == "Yes":
remote_flag = "Y"
else:
remote_flag = "N"
return remote_flag
def get_browser_version(browser):
"Get the browser version"
if browser == "chrome":
browser_version=questionary.select("Select the browser version",
choices=conf.chrome_versions).ask()
elif browser == "firefox":
browser_version=questionary.select("Select the browser version",
choices=conf.firefox_versions).ask()
elif browser == "safari":
browser_version = questionary.select("Select the browser version",
choices=conf.safari_versions).ask()
return browser_version
def get_os_version(os_name):
"Get OS Version"
if os_name == "windows":
os_version = questionary.select("Select the OS version",
choices=conf.windows_versions).ask()
elif os_name == "OS X":
if (os.getenv('REMOTE_BROWSER_PLATFORM') == "SL"):
os_version = questionary.select("Select the OS version",
choices=conf.sauce_labs_os_x_versions).ask()
else:
os_version = questionary.select("Select the OS version",
choices=conf.os_x_versions).ask()
else:
os_version= []
questionary.print("Please select the OS Name first",
style="bold fg:darkred")
return os_version
def get_os_name(remote_flag):
"Get OS Name"
os_name = questionary.select("Enter the OS version",choices=conf.os_list).ask()
os_version = []
if remote_flag == "Y":
questionary.print("Please select the OS Version",style="bold fg:darkred")
return os_name, os_version
def gui_default_options():
"The default options for GUI tests"
browser = conf.default_browser[0]
os_name = []
os_version = []
browser_version = []
remote_flag = "N"
testrail_flag = "N"
tesults_flag = "N"
return browser, os_name, os_version, browser_version, remote_flag, testrail_flag, tesults_flag
def mobile_display_options(mobile_os_name, mobile_os_version, device_name,
app_package, app_activity, remote_flag, device_flag,
testrail_flag, tesults_flag, app_name,app_path):
"Display the selected options for mobile tests"
print("Mobile OS Name:",mobile_os_name)
print("Mobile OS Version:",mobile_os_version)
print("Device Name:",device_name)
print("App Package:",app_package)
print("App Activity:",app_activity)
print("Remote Flag status:",remote_flag)
print("Device Flag status:",device_flag)
print("Testrail Flag status:",testrail_flag)
print("Tesults Flag status:",tesults_flag)
print("App Name:",app_name)
print("App Path:",app_path)
def mobile_android_devices(mobile_os_version):
"Get device name for android devices"
questionary.print("The devices that support Android %s has been listed.\
\nPlease select any one device"%(mobile_os_version),
style="bold fg:green")
if mobile_os_version == "10.0":
device_name = questionary.select("Select the device name",
choices=["Samsung Galaxy S20",
"Samsung Galaxy Note 20", "Google Pixel 4",
"Google Pixel 3","OnePlus 8",
"Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "9.0":
device_name = questionary.select("Select the device name",
choices=["Samsung Galaxy S10",
"Samsung Galaxy A51", "Google Pixel 3a",
"Xiaomi Redmi Note 8","OnePlus 7",
"Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "8.0":
device_name = questionary.select("Select the device name",
choices=["Samsung Galaxy S9",
"Google Pixel 2",
"Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "8.1":
device_name = questionary.select("Select the device name",
choices=["Samsung Galaxy Note 9",
"Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "7.1":
device_name = questionary.select("Select the device name",
choices=["Samsung Galaxy Note 8",
"Google Pixel","Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "7.0":
device_name=questionary.select("Select the device name",
choices=["Samsung Galaxy S8",
"Google Nexus 6P", "Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "6.0":
device_name = questionary.select("Select the device name",
choices=["Samsung Galaxy S7",
"Google Nexus 6","Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
else:
device_name = questionary.text("Enter the Device name").ask()
return device_name
def mobile_ios_devices(mobile_os_version):
"Get device name for ios devices"
questionary.print("The devices that support iOS %s has been listed.\
\nPlease select any one device"%(mobile_os_version),
style = "bold fg:green")
if mobile_os_version == "8.0":
device_name = questionary.select("Select the device name",
choices=["iPhone 6",
"iPhone 6 Plus",
"Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "9.0":
device_name = questionary.select("Select the device name",
choices=["iPhone 6S","iPhone 6S Plus",
"Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "10.0":
device_name = questionary.select("Select the device name",
choices=["iPhone 7",
"Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "11.0":
device_name = questionary.select("Select the device name",
choices=["iPhone 6","iPhone 6S",
"iPhone 6S Plus","iPhone SE",
"Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "12.0":
device_name = questionary.select("Select the device name",
choices=["iPhone 7","iPhone 8",
"iPhone XS","Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "13.0":
device_name = questionary.select("Select the device name",
choices=["iPhone 11","iPhone 11 Pro",
"iPhone 8","Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
elif mobile_os_version == "14.0":
device_name = questionary.select("Select the device name",
choices=["iPhone 11","iPhone 12",
"iPhone 12 Pro","Other Devices"]).ask()
if device_name == "Other Devices":
device_name = questionary.text("Enter the device name").ask()
else:
device_name = questionary.text("Enter the Device name").ask()
return device_name
def mobile_default_options():
"The default options for mobile tests"
mobile_os_name = "Android"
mobile_os_version = "8.0"
device_name = "Samsung Galaxy S9"
app_package = "com.dudam.rohan.bitcoininfo"
app_activity = ".MainActivity"
remote_flag = "N"
device_flag = "N"
testrail_flag = "N"
tesults_flag = "N"
app_name = "Bitcoin Info_com.dudam.rohan.bitcoininfo.apk"
app_path = None
return (mobile_os_name, mobile_os_version, device_name, app_package,
app_activity, remote_flag, device_flag, testrail_flag,
tesults_flag, app_name, app_path)
def get_mobile_os_name():
"Get the mobile OS name"
mobile_os_name=questionary.select("Select the Mobile OS",
choices=["Android","iOS"]).ask()
if mobile_os_name == "Android":
mobile_os_version = "8.0"
device_name = "Samsung Galaxy S9"
questionary.print("The default os version and device for Android has been selected.\
\nYou can change it as desired from the menu",
style="bold fg:green")
if mobile_os_name == "iOS":
mobile_os_version = "8.0"
device_name = "iPhone 6"
questionary.print("The default os version and device for iOS has been selected.\
\nYou can change it as desired from the menu",
style="bold fg:green")
return mobile_os_name, mobile_os_version, device_name
def get_mobile_os_version(mobile_os_name):
"Get mobile OS version"
if mobile_os_name == "Android":
mobile_os_version = questionary.select("Select the Mobile OS version",
choices=["6.0","7.0","7.1",
"8.0","8.1","9.0",
"Other versions"]).ask()
elif mobile_os_name == "iOS":
mobile_os_version = questionary.select("Select the Mobile OS version",
choices=["8.0","9.0","10.0","11.0",
"12.0","13.0","14.0",
"Other versions"]).ask()
if mobile_os_version == "Other versions":
mobile_os_version = questionary.text("Enter the OS version").ask()
return mobile_os_version
def get_sessionflag_status():
"Get the session flag status"
session_flag=questionary.select("Select the Session flag status",
choices=["True","False"]).ask()
if session_flag == "True":
session_flag = True
if session_flag == "False":
session_flag = False
return session_flag
def get_api_url():
"Get the API URL"
api_url = questionary.select("Select the API url",
choices=["localhost",
"https://cars-app.qxf2.com/",
"Enter the URL manually"]).ask()
if api_url == "localhost":
api_url = base_url_conf.api_base_url
if api_url == "Enter the URL manually":
api_url = questionary.text("Enter the url").ask()
return api_url
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/excel_compare.py
|
"""
Qxf2 Services: Utility script to compare two excel files using openxl module
"""
import openpyxl
import os
class Excel_Compare():
def is_equal(self,xl_actual,xl_expected):
"Method to compare the Actual and Expected xl file"
result_flag = True
if not os.path.exists(xl_actual):
result_flag = False
print('Could not locate the excel file: %s'%xl_actual)
if not os.path.exists(xl_expected):
result_flag = False
print('Could not locate the excel file %s'%xl_expected)
if os.path.exists(xl_actual) and os.path.exists(xl_expected):
#Open the xl file and put the content to list
actual_xlfile = openpyxl.load_workbook(xl_actual)
xl_sheet = actual_xlfile.active
actual_file = []
for row in xl_sheet.iter_rows(min_row=1, max_col=xl_sheet.max_column, max_row=xl_sheet.max_row):
for cell in row:
actual_file.append(cell.value)
exp_xlfile = openpyxl.load_workbook(xl_expected)
xl_sheet = exp_xlfile.active
exp_file = []
for row in xl_sheet.iter_rows(min_row=1, max_col=xl_sheet.max_column, max_row=xl_sheet.max_row):
for cell in row:
exp_file.append(cell.value)
#If there is row and column mismatch result_flag = False
if (len(actual_file)!= len(exp_file)):
result_flag = False
print("Mismatch in number of rows or columns. The actual row or column count didn't match with expected row or column count")
else:
for actual_row, actual_col in zip(actual_file,exp_file):
if actual_row == actual_col:
pass
else:
print("Mismatch between actual and expected file at position(each row consists of 23 coordinates):",actual_file.index(actual_row))
print("Data present only in Actual file: %s"%actual_row)
print("Data present only in Expected file: %s"%actual_col)
result_flag = False
return result_flag
#---USAGE EXAMPLES
if __name__=='__main__':
print("Start of %s"%__file__)
# Enter the path details of the xl files here
file1 = 'Add path to the first xl file'
file2 = 'Add path to the second xl file'
#Initialize the excel object
xl_obj = Excel_Compare()
#Sample code to compare excel files
if xl_obj.is_equal(file1,file2) is True:
print("Data matched in both the excel files\n")
else:
print("Data mismatch between the actual and expected excel files")
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/axe.min.js
|
!function e(window){var document=window.document,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function c(e){this.name="SupportError",this.cause=e.cause,this.message="`"+e.cause+"` - feature unsupported in your environment.",e.ruleId&&(this.ruleId=e.ruleId,this.message+=" Skipping "+this.ruleId+" rule."),this.stack=(new Error).stack}(axe=axe||{}).version="3.1.1","function"==typeof define&&define.amd&&define("axe-core",[],function(){"use strict";return axe}),"object"===("undefined"==typeof module?"undefined":T(module))&&module.exports&&"function"==typeof e.toString&&(axe.source="("+e.toString()+')(typeof window === "object" ? window : this);',module.exports=axe),"function"==typeof window.getComputedStyle&&(window.axe=axe),(c.prototype=Object.create(Error.prototype)).constructor=c,axe.imports={};var utils=axe.utils={},i={},p=(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e});function t(e,t,r){"use strict";var a,n;for(a=0,n=e.length;a<n;a++)t[r](e[a])}function r(e){this.brand="axe",this.application="axeAPI",this.tagExclude=["experimental"],this.defaultConfig=e,this._init(),this._defaultLocale=null}r.prototype._setDefaultLocale=function(){if(!this._defaultLocale){for(var e={checks:{},rules:{}},t=Object.keys(this.data.checks),r=0;r<t.length;r++){var a=t[r],n=this.data.checks[a].messages,o=n.pass,i=n.fail,s=n.incomplete;e.checks[a]={pass:o,fail:i,incomplete:s}}for(var l=Object.keys(this.data.rules),u=0;u<l.length;u++){var c=l[u],d=this.data.rules[c],m=d.description,p=d.help;e.rules[c]={description:m,help:p}}this._defaultLocale=e}},r.prototype._resetLocale=function(){var e=this._defaultLocale;e&&this.applyLocale(e)};function f(n,e,o){var t=void 0,i=void 0;return o.performanceTimer&&(t="mark_rule_start_"+n.id,i="mark_rule_end_"+n.id,axe.utils.performanceTimer.mark(t)),function(r,a){n.run(e,o,function(e){o.performanceTimer&&(axe.utils.performanceTimer.mark(i),axe.utils.performanceTimer.measure("rule_"+n.id,t,i)),r(e)},function(e){if(o.debug)a(e);else{var t=Object.assign(new m(n),{result:axe.constants.CANTTELL,description:"An error occured while running this rule",message:e.message,stack:e.stack,error:e});r(t)}})}}function o(e,t,r){var a=e.brand,n=e.application;return axe.constants.helpUrlBase+a+"/"+(r||axe.version.substring(0,axe.version.lastIndexOf(".")))+"/"+t+"?application="+n}function d(e){"use strict";this.id=e.id,this.data=null,this.relatedNodes=[],this.result=null}function a(e){"use strict";return"string"==typeof e?new Function("return "+e+";")():e}function n(e){e&&(this.id=e.id,this.configure(e))}r.prototype._applyCheckLocale=function(e){for(var t,r,a,n,o=Object.keys(e),i=0;i<o.length;i++){var s=o[i];if(!this.data.checks[s])throw new Error('Locale provided for unknown check: "'+s+'"');this.data.checks[s]=(t=this.data.checks[s],r=e[s],n=a=void 0,a=r.pass,n=r.fail,"string"==typeof a&&(a=axe.imports.doT.compile(a)),"string"==typeof n&&(n=axe.imports.doT.compile(n)),p({},t,{messages:{pass:a||t.messages.pass,fail:n||t.messages.fail,incomplete:"object"===T(t.messages.incomplete)?p({},t.messages.incomplete,r.incomplete):r.incomplete}}))}},r.prototype._applyRuleLocale=function(e){for(var t,r,a,n,o=Object.keys(e),i=0;i<o.length;i++){var s=o[i];if(!this.data.rules[s])throw new Error('Locale provided for unknown rule: "'+s+'"');this.data.rules[s]=(t=this.data.rules[s],r=e[s],n=a=void 0,a=r.help,n=r.description,"string"==typeof a&&(a=axe.imports.doT.compile(a)),"string"==typeof n&&(n=axe.imports.doT.compile(n)),p({},t,{help:a||t.help,description:n||t.description}))}},r.prototype.applyLocale=function(e){this._setDefaultLocale(),e.checks&&this._applyCheckLocale(e.checks),e.rules&&this._applyRuleLocale(e.rules)},r.prototype._init=function(){var e=function(e){"use strict";var t;return e?(t=axe.utils.clone(e)).commons=e.commons:t={},t.reporter=t.reporter||null,t.rules=t.rules||[],t.checks=t.checks||[],t.data=p({checks:{},rules:{}},t.data),t}(this.defaultConfig);axe.commons=e.commons,this.reporter=e.reporter,this.commands={},this.rules=[],this.checks={},t(e.rules,this,"addRule"),t(e.checks,this,"addCheck"),this.data={},this.data.checks=e.data&&e.data.checks||{},this.data.rules=e.data&&e.data.rules||{},this.data.failureSummaries=e.data&&e.data.failureSummaries||{},this.data.incompleteFallbackMessage=e.data&&e.data.incompleteFallbackMessage||"",this._constructHelpUrls()},r.prototype.registerCommand=function(e){"use strict";this.commands[e.id]=e.callback},r.prototype.addRule=function(e){"use strict";e.metadata&&(this.data.rules[e.id]=e.metadata);var t=this.getRule(e.id);t?t.configure(e):this.rules.push(new h(e,this))},r.prototype.addCheck=function(e){"use strict";var t=e.metadata;"object"===(void 0===t?"undefined":T(t))&&(this.data.checks[e.id]=t,"object"===T(t.messages)&&Object.keys(t.messages).filter(function(e){return t.messages.hasOwnProperty(e)&&"string"==typeof t.messages[e]}).forEach(function(e){0===t.messages[e].indexOf("function")&&(t.messages[e]=new Function("return "+t.messages[e]+";")())})),this.checks[e.id]?this.checks[e.id].configure(e):this.checks[e.id]=new n(e)},r.prototype.run=function(o,i,s,l){"use strict";this.normalizeOptions(i),axe._selectCache=[];var e,r,a,t=(e=this.rules,r=o,a=i,e.reduce(function(e,t){return axe.utils.ruleShouldRun(t,r,a)&&(t.preload?e.later.push(t):e.now.push(t)),e},{now:[],later:[]})),n=t.now,u=t.later,c=axe.utils.queue();n.forEach(function(e){c.defer(f(e,o,i))});var d=axe.utils.queue();u.length&&d.defer(function(r,e){axe.utils.preload(i).then(function(e){var t=e[0];r(t)}).catch(function(e){console.warn("Couldn't load preload assets: ",e);r(void 0)})});var m=axe.utils.queue();m.defer(c),m.defer(d),m.then(function(e){var t=e.pop();if(t&&t.length){var r=t[0];r&&(o=p({},o,r))}var a=e[0];if(!u.length)return axe._selectCache=void 0,void s(a.filter(function(e){return!!e}));var n=axe.utils.queue();u.forEach(function(e){var t=f(e,o,i);n.defer(t)}),n.then(function(e){axe._selectCache=void 0,s(a.concat(e).filter(function(e){return!!e}))}).catch(l)}).catch(l)},r.prototype.after=function(e,r){"use strict";var a=this.rules;return e.map(function(e){var t=axe.utils.findBy(a,"id",e.id);if(!t)throw new Error("Result for unknown rule. You may be running mismatch aXe-core versions");return t.after(e,r)})},r.prototype.getRule=function(t){return this.rules.find(function(e){return e.id===t})},r.prototype.normalizeOptions=function(e){"use strict";var t=this;if("object"===T(e.runOnly)){Array.isArray(e.runOnly)&&(e.runOnly={type:"tag",values:e.runOnly});var r=e.runOnly;if(r.value&&!r.values&&(r.values=r.value,delete r.value),!Array.isArray(r.values)||0===r.values.length)throw new Error("runOnly.values must be a non-empty array");if(["rule","rules"].includes(r.type))r.type="rule",r.values.forEach(function(e){if(!t.getRule(e))throw new Error("unknown rule `"+e+"` in options.runOnly")});else{if(!["tag","tags",void 0].includes(r.type))throw new Error("Unknown runOnly type '"+r.type+"'");r.type="tag";var a=t.rules.reduce(function(e,t){return e.length?e.filter(function(e){return!t.tags.includes(e)}):e},r.values);if(0!==a.length)throw new Error("Could not find tags `"+a.join("`, `")+"`")}}return"object"===T(e.rules)&&Object.keys(e.rules).forEach(function(e){if(!t.getRule(e))throw new Error("unknown rule `"+e+"` in options.rules")}),e},r.prototype.setBranding=function(e){"use strict";var t={brand:this.brand,application:this.application};e&&e.hasOwnProperty("brand")&&e.brand&&"string"==typeof e.brand&&(this.brand=e.brand),e&&e.hasOwnProperty("application")&&e.application&&"string"==typeof e.application&&(this.application=e.application),this._constructHelpUrls(t)},r.prototype._constructHelpUrls=function(){var r=this,a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=(axe.version.match(/^[1-9][0-9]*\.[0-9]+/)||["x.y"])[0];this.rules.forEach(function(e){r.data.rules[e.id]||(r.data.rules[e.id]={});var t=r.data.rules[e.id];("string"!=typeof t.helpUrl||a&&t.helpUrl===o(a,e.id,n))&&(t.helpUrl=o(r,e.id,n))})},r.prototype.resetRulesAndChecks=function(){"use strict";this._init(),this._resetLocale()},n.prototype.enabled=!0,n.prototype.run=function(e,t,r,a,n){"use strict";var o=(t=t||{}).hasOwnProperty("enabled")?t.enabled:this.enabled,i=t.options||this.options;if(o){var s,l=new d(this),u=axe.utils.checkHelper(l,t,a,n);try{s=this.evaluate.call(u,e.actualNode,i,e,r)}catch(e){return void n(e)}u.isAsync||(l.result=s,setTimeout(function(){a(l)},0))}else a(null)},n.prototype.configure=function(t){var r=this;["options","enabled"].filter(function(e){return t.hasOwnProperty(e)}).forEach(function(e){return r[e]=t[e]}),["evaluate","after"].filter(function(e){return t.hasOwnProperty(e)}).forEach(function(e){return r[e]=a(t[e])})};T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function s(e,t,r){"use strict";var a,n;e.frames=e.frames||[];var o=document.querySelectorAll(r.shift());e:for(var i=0,s=o.length;i<s;i++){n=o[i];for(var l=0,u=e.frames.length;l<u;l++)if(e.frames[l].node===n){e.frames[l][t].push(r);break e}a={node:n,include:[],exclude:[]},r&&a[t].push(r),e.frames.push(a)}}function l(t,e){"use strict";for(var r,a,n=[],o=0,i=t[e].length;o<i;o++){if("string"==typeof(r=t[e][o])){a=Array.from(document.querySelectorAll(r)),n=n.concat(a.map(function(e){return axe.utils.getNodeFromTree(t.flatTree[0],e)}));break}!r||!r.length||r instanceof Node?r instanceof Node&&(r.documentElement instanceof Node?n.push(t.flatTree[0]):n.push(axe.utils.getNodeFromTree(t.flatTree[0],r))):1<r.length?s(t,e,r):(a=Array.from(document.querySelectorAll(r[0])),n=n.concat(a.map(function(e){return axe.utils.getNodeFromTree(t.flatTree[0],e)})))}return n.filter(function(e){return e})}function u(e){"use strict";var t,r,a,n=this;this.frames=[],this.initiator=!e||"boolean"!=typeof e.initiator||e.initiator,this.page=!1,e=function(e){if(e&&"object"===(void 0===e?"undefined":T(e))||e instanceof NodeList){if(e instanceof Node)return{include:[e],exclude:[]};if(e.hasOwnProperty("include")||e.hasOwnProperty("exclude"))return{include:e.include&&+e.include.length?e.include:[document],exclude:e.exclude||[]};if(e.length===+e.length)return{include:e,exclude:[]}}return"string"==typeof e?{include:[e],exclude:[]}:{include:[document],exclude:[]}}(e),this.flatTree=axe.utils.getFlattenedTree((r=(t=e).include,a=t.exclude,(Array.from(r).concat(Array.from(a)).reduce(function(e,t){return e||(t instanceof Element?t.ownerDocument:t instanceof Document?t:void 0)},null)||document).documentElement)),this.exclude=e.exclude,this.include=e.include,this.include=l(this,"include"),this.exclude=l(this,"exclude"),axe.utils.select("frame, iframe",this).forEach(function(e){var t,r;ve(e,n)&&(t=n.frames,r=e.actualNode,axe.utils.isHidden(r)||axe.utils.findBy(t,"node",r)||t.push({node:r,include:[],exclude:[]}))}),1===this.include.length&&this.include[0].actualNode===document.documentElement&&(this.page=!0);var o=function(e){if(0===e.include.length){if(0===e.frames.length){var t=axe.utils.respondable.isInFrame()?"frame":"page";return new Error("No elements found for include in "+t+" Context")}e.frames.forEach(function(e,t){if(0===e.include.length)return new Error("No elements found for include in Context of frame "+t)})}}(this);if(o instanceof Error)throw o;Array.isArray(this.include)||(this.include=Array.from(this.include)),this.include.sort(axe.utils.nodeSorter)}function m(e){"use strict";this.id=e.id,this.result=axe.constants.NA,this.pageLevel=e.pageLevel,this.impact=null,this.nodes=[]}function h(e,t){"use strict";this._audit=t,this.id=e.id,this.selector=e.selector||"*",this.excludeHidden="boolean"!=typeof e.excludeHidden||e.excludeHidden,this.enabled="boolean"!=typeof e.enabled||e.enabled,this.pageLevel="boolean"==typeof e.pageLevel&&e.pageLevel,this.any=e.any||[],this.all=e.all||[],this.none=e.none||[],this.tags=e.tags||[],this.preload=!!e.preload,e.matches&&(this.matches=a(e.matches))}h.prototype.matches=function(){"use strict";return!0},h.prototype.gather=function(e){"use strict";var t=axe.utils.select(this.selector,e);return this.excludeHidden?t.filter(function(e){return!axe.utils.isHidden(e.actualNode)}):t},h.prototype.runChecks=function(t,n,o,i,r,e){"use strict";var s=this,l=axe.utils.queue();this[t].forEach(function(e){var r=s._audit.checks[e.id||e],a=axe.utils.getCheckOption(r,s.id,o);l.defer(function(e,t){r.run(n,a,i,e,t)})}),l.then(function(e){e=e.filter(function(e){return e}),r({type:t,results:e})}).catch(e)},h.prototype.run=function(a,o,e,t){var i=this,r=axe.utils.queue(),s=new m(this),n="mark_runchecks_start_"+this.id,l="mark_runchecks_end_"+this.id,u=void 0;try{u=this.gather(a).filter(function(e){return i.matches(e.actualNode,e)})}catch(e){return void t(new c({cause:e,ruleId:this.id}))}o.performanceTimer&&(axe.log("gather (",u.length,"):",axe.utils.performanceTimer.timeElapsed()+"ms"),axe.utils.performanceTimer.mark(n)),u.forEach(function(n){r.defer(function(t,r){var e=axe.utils.queue();["any","all","none"].forEach(function(r){e.defer(function(e,t){i.runChecks(r,n,o,a,e,t)})}),e.then(function(e){if(e.length){var r=!1,a={};e.forEach(function(e){var t=e.results.filter(function(e){return e});(a[e.type]=t).length&&(r=!0)}),r&&(a.node=new axe.utils.DqElement(n.actualNode,o),s.nodes.push(a))}t()}).catch(function(e){return r(e)})})}),o.performanceTimer&&(axe.utils.performanceTimer.mark(l),axe.utils.performanceTimer.measure("runchecks_"+this.id,n,l)),r.then(function(){return e(s)}).catch(function(e){return t(e)})},h.prototype.after=function(s,l){"use strict";var r,e,a,t,n=(r=this,axe.utils.getAllChecks(r).map(function(e){var t=r._audit.checks[e.id||e];return t&&"function"==typeof t.after?t:null}).filter(Boolean)),u=this.id;return n.forEach(function(e){var t,r,a,n=(t=s.nodes,r=e.id,a=[],t.forEach(function(e){axe.utils.getAllChecks(e).forEach(function(e){e.id===r&&a.push(e)})}),a),o=axe.utils.getCheckOption(e,u,l),i=e.after(n,o);n.forEach(function(e){-1===i.indexOf(e)&&(e.filtered=!0)})}),s.nodes=(a=["any","all","none"],t=(e=s).nodes.filter(function(t){var r=0;return a.forEach(function(e){t[e]=t[e].filter(function(e){return!0!==e.filtered}),r+=t[e].length}),0<r}),e.pageLevel&&t.length&&(t=[t.reduce(function(t,r){if(t)return a.forEach(function(e){t[e].push.apply(t[e],r[e])}),t})]),t),s},h.prototype.configure=function(e){"use strict";e.hasOwnProperty("selector")&&(this.selector=e.selector),e.hasOwnProperty("excludeHidden")&&(this.excludeHidden="boolean"!=typeof e.excludeHidden||e.excludeHidden),e.hasOwnProperty("enabled")&&(this.enabled="boolean"!=typeof e.enabled||e.enabled),e.hasOwnProperty("pageLevel")&&(this.pageLevel="boolean"==typeof e.pageLevel&&e.pageLevel),e.hasOwnProperty("any")&&(this.any=e.any),e.hasOwnProperty("all")&&(this.all=e.all),e.hasOwnProperty("none")&&(this.none=e.none),e.hasOwnProperty("tags")&&(this.tags=e.tags),e.hasOwnProperty("matches")&&("string"==typeof e.matches?this.matches=new Function("return "+e.matches+";")():this.matches=e.matches)},function(axe){var o={helpUrlBase:"https://dequeuniversity.com/rules/",results:[],resultGroups:[],resultGroupMap:{},impact:Object.freeze(["minor","moderate","serious","critical"]),preloadAssets:Object.freeze(["cssom"]),preloadAssetsTimeout:1e4};[{name:"NA",value:"inapplicable",priority:0,group:"inapplicable"},{name:"PASS",value:"passed",priority:1,group:"passes"},{name:"CANTTELL",value:"cantTell",priority:2,group:"incomplete"},{name:"FAIL",value:"failed",priority:3,group:"violations"}].forEach(function(e){var t=e.name,r=e.value,a=e.priority,n=e.group;o[t]=r,o[t+"_PRIO"]=a,o[t+"_GROUP"]=n,o.results[a]=r,o.resultGroups[a]=n,o.resultGroupMap[r]=n}),Object.freeze(o.results),Object.freeze(o.resultGroups),Object.freeze(o.resultGroupMap),Object.freeze(o),Object.defineProperty(axe,"constants",{value:o,enumerable:!0,configurable:!1,writable:!1})}(axe);T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};axe.imports.axios=function(r){var a={};function n(e){if(a[e])return a[e].exports;var t=a[e]={exports:{},id:e,loaded:!1};return r[e].call(t.exports,t,t.exports,n),t.loaded=!0,t.exports}return n.m=r,n.c=a,n.p="",n(0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";var utils=r(2),a=r(3),n=r(5),o=r(6);function i(e){var t=new n(e),r=a(n.prototype.request,t);return utils.extend(r,n.prototype,t),utils.extend(r,t),r}var s=i(o);s.Axios=n,s.create=function(e){return i(utils.merge(o,e))},s.Cancel=r(23),s.CancelToken=r(24),s.isCancel=r(20),s.all=function(e){return Promise.all(e)},s.spread=r(25),e.exports=s,e.exports.default=s},function(e,t,r){"use strict";var n=r(3),a=r(4),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return null!==e&&"object"===(void 0===e?"undefined":T(e))}function l(e){return"[object Function]"===o.call(e)}function u(e,t){if(null!=e)if("object"!==(void 0===e?"undefined":T(e))&&(e=[e]),i(e))for(var r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(null,e[n],n,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:a,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:l,isStream:function(e){return s(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&void 0!==window&&void 0!==document},forEach:u,merge:function r(){var a={};function e(e,t){"object"===T(a[t])&&"object"===(void 0===e?"undefined":T(e))?a[t]=r(a[t],e):a[t]=e}for(var t=0,n=arguments.length;t<n;t++)u(arguments[t],e);return a},extend:function(r,e,a){return u(e,function(e,t){r[t]=a&&"function"==typeof e?n(e,a):e}),r},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t){"use strict";e.exports=function(r,a){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];return r.apply(a,e)}}},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(r(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))||!!e._isBuffer);var t}},function(e,t,r){"use strict";var a=r(6),utils=r(2),n=r(17),o=r(18);function i(e){this.defaults=e,this.interceptors={request:new n,response:new n}}i.prototype.request=function(e){"string"==typeof e&&(e=utils.merge({url:arguments[0]},arguments[1])),(e=utils.merge(a,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[o,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},utils.forEach(["delete","get","head","options"],function(r){i.prototype[r]=function(e,t){return this.request(utils.merge(t||{},{method:r,url:e}))}}),utils.forEach(["post","put","patch"],function(a){i.prototype[a]=function(e,t,r){return this.request(utils.merge(r||{},{method:a,url:e,data:t}))}}),e.exports=i},function(e,t,r){"use strict";var utils=r(2),a=r(7),n={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!utils.isUndefined(e)&&utils.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i,s={adapter:("undefined"!=typeof XMLHttpRequest?i=r(8):"undefined"!=typeof process&&(i=r(8)),i),transformRequest:[function(e,t){return a(t,"Content-Type"),utils.isFormData(e)||utils.isArrayBuffer(e)||utils.isBuffer(e)||utils.isStream(e)||utils.isFile(e)||utils.isBlob(e)?e:utils.isArrayBufferView(e)?e.buffer:utils.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):utils.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],function(e){s.headers[e]={}}),utils.forEach(["post","put","patch"],function(e){s.headers[e]=utils.merge(n)}),e.exports=s},function(e,t,r){"use strict";var utils=r(2);e.exports=function(r,a){utils.forEach(r,function(e,t){t!==a&&t.toUpperCase()===a.toUpperCase()&&(r[a]=e,delete r[t])})}},function(e,t,m){"use strict";var utils=m(2),p=m(9),f=m(12),h=m(13),g=m(14),b=m(10),y=void 0!==window&&window.btoa&&window.btoa.bind(window)||m(15);e.exports=function(d){return new Promise(function(r,a){var n=d.data,o=d.headers;utils.isFormData(n)&&delete o["Content-Type"];var i=new XMLHttpRequest,e="onreadystatechange",s=!1;if(void 0===window||!window.XDomainRequest||"withCredentials"in i||g(d.url)||(i=new window.XDomainRequest,e="onload",s=!0,i.onprogress=function(){},i.ontimeout=function(){}),d.auth){var t=d.auth.username||"",l=d.auth.password||"";o.Authorization="Basic "+y(t+":"+l)}if(i.open(d.method.toUpperCase(),f(d.url,d.params,d.paramsSerializer),!0),i.timeout=d.timeout,i[e]=function(){if(i&&(4===i.readyState||s)&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var e="getAllResponseHeaders"in i?h(i.getAllResponseHeaders()):null,t={data:d.responseType&&"text"!==d.responseType?i.response:i.responseText,status:1223===i.status?204:i.status,statusText:1223===i.status?"No Content":i.statusText,headers:e,config:d,request:i};p(r,a,t),i=null}},i.onerror=function(){a(b("Network Error",d,null,i)),i=null},i.ontimeout=function(){a(b("timeout of "+d.timeout+"ms exceeded",d,"ECONNABORTED",i)),i=null},utils.isStandardBrowserEnv()){var u=m(16),c=(d.withCredentials||g(d.url))&&d.xsrfCookieName?u.read(d.xsrfCookieName):void 0;c&&(o[d.xsrfHeaderName]=c)}if("setRequestHeader"in i&&utils.forEach(o,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)}),d.withCredentials&&(i.withCredentials=!0),d.responseType)try{i.responseType=d.responseType}catch(e){if("json"!==d.responseType)throw e}"function"==typeof d.onDownloadProgress&&i.addEventListener("progress",d.onDownloadProgress),"function"==typeof d.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",d.onUploadProgress),d.cancelToken&&d.cancelToken.promise.then(function(e){i&&(i.abort(),a(e),i=null)}),void 0===n&&(n=null),i.send(n)})}},function(e,t,r){"use strict";var n=r(10);e.exports=function(e,t,r){var a=r.config.validateStatus;r.status&&a&&!a(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";var i=r(11);e.exports=function(e,t,r,a,n){var o=new Error(e);return i(o,t,r,a,n)}},function(e,t){"use strict";e.exports=function(e,t,r,a,n){return e.config=t,r&&(e.code=r),e.request=a,e.response=n,e}},function(e,t,r){"use strict";var utils=r(2);function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var a;if(r)a=r(t);else if(utils.isURLSearchParams(t))a=t.toString();else{var n=[];utils.forEach(t,function(e,t){null!=e&&(utils.isArray(e)?t+="[]":e=[e],utils.forEach(e,function(e){utils.isDate(e)?e=e.toISOString():utils.isObject(e)&&(e=JSON.stringify(e)),n.push(o(t)+"="+o(e))}))}),a=n.join("&")}return a&&(e+=(-1===e.indexOf("?")?"?":"&")+a),e}},function(e,t,r){"use strict";var utils=r(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,a,n={};return e&&utils.forEach(e.split("\n"),function(e){if(a=e.indexOf(":"),t=utils.trim(e.substr(0,a)).toLowerCase(),r=utils.trim(e.substr(a+1)),t){if(n[t]&&0<=o.indexOf(t))return;n[t]="set-cookie"===t?(n[t]?n[t]:[]).concat([r]):n[t]?n[t]+", "+r:r}}),n}},function(e,t,r){"use strict";var utils=r(2);e.exports=utils.isStandardBrowserEnv()?function(){var r,a=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var t=e;return a&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(e){var t=utils.isString(e)?o(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0}},function(e,t){"use strict";function s(){this.message="String contains an invalid character"}(s.prototype=new Error).code=5,s.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,r,a=String(e),n="",o=0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a.charAt(0|o)||(i="=",o%1);n+=i.charAt(63&t>>8-o%1*8)){if(255<(r=a.charCodeAt(o+=.75)))throw new s;t=t<<8|r}return n}},function(e,t,r){"use strict";var utils=r(2);e.exports=utils.isStandardBrowserEnv()?{write:function(e,t,r,a,n,o){var i=[];i.push(e+"="+encodeURIComponent(t)),utils.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),utils.isString(a)&&i.push("path="+a),utils.isString(n)&&i.push("domain="+n),!0===o&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var utils=r(2);function a(){this.handlers=[]}a.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.forEach=function(t){utils.forEach(this.handlers,function(e){null!==e&&t(e)})},e.exports=a},function(e,t,r){"use strict";var utils=r(2),a=r(19),n=r(20),o=r(6),i=r(21),s=r(22);function l(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(t){return l(t),t.baseURL&&!i(t.url)&&(t.url=s(t.baseURL,t.url)),t.headers=t.headers||{},t.data=a(t.data,t.headers,t.transformRequest),t.headers=utils.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),utils.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||o.adapter)(t).then(function(e){return l(t),e.data=a(e.data,e.headers,t.transformResponse),e},function(e){return n(e)||(l(t),e&&e.response&&(e.response.data=a(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(e,t,r){"use strict";var utils=r(2);e.exports=function(t,r,e){return utils.forEach(e,function(e){t=e(t,r)}),t}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,r){"use strict";var a=r(23);function n(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;e(function(e){r.reason||(r.reason=new a(e),t(r.reason))})}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var t;return{token:new n(function(e){t=e}),cancel:t}},e.exports=n},function(e,t){"use strict";e.exports=function(t){return function(e){return t.apply(null,e)}}}]),axe.imports.doT=function(e,t,r,a,n){var o=Function("return this")(),i=o.doT;!function(){"use strict";var l,u={name:"doT",version:"1.1.1",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:!0,append:!0,selfcontained:!1,doNotSkipEncoded:!1},template:void 0,compile:void 0,log:!0};u.encodeHTMLSource=function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},r=e?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(e){return e?e.toString().replace(r,function(e){return t[e]||e}):""}},(l=function(){return this||(0,eval)("this")}()).doT=u;var c={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},d=/$^/;function m(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}u.template=function(e,t,r){var a,n,o=(t=t||u.templateSettings).append?c.append:c.split,i=0,s=t.use||t.define?function a(n,e,o){return("string"==typeof e?e:e.toString()).replace(n.define||d,function(e,a,t,r){return 0===a.indexOf("def.")&&(a=a.substring(4)),a in o||(":"===t?(n.defineParams&&r.replace(n.defineParams,function(e,t,r){o[a]={arg:t,text:r}}),a in o||(o[a]=r)):new Function("def","def['"+a+"']="+r)(o)),""}).replace(n.use||d,function(e,t){n.useParams&&(t=t.replace(n.useParams,function(e,t,r,a){if(o[r]&&o[r].arg&&a){var n=(r+":"+a).replace(/'|\\/g,"_");return o.__exp=o.__exp||{},o.__exp[n]=o[r].text.replace(new RegExp("(^|[^\\w$])"+o[r].arg+"([^\\w$])","g"),"$1"+a+"$2"),t+"def.__exp['"+n+"']"}}));var r=new Function("def","return "+t)(o);return r?a(n,r,o):r})}(t,e,r||{}):e;s=("var out='"+(t.strip?s.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):s).replace(/'|\\/g,"\\$&").replace(t.interpolate||d,function(e,t){return o.start+m(t)+o.end}).replace(t.encode||d,function(e,t){return a=!0,o.startencode+m(t)+o.end}).replace(t.conditional||d,function(e,t,r){return t?r?"';}else if("+m(r)+"){out+='":"';}else{out+='":r?"';if("+m(r)+"){out+='":"';}out+='"}).replace(t.iterate||d,function(e,t,r,a){return t?(i+=1,n=a||"i"+i,t=m(t),"';var arr"+i+"="+t+";if(arr"+i+"){var "+r+","+n+"=-1,l"+i+"=arr"+i+".length-1;while("+n+"<l"+i+"){"+r+"=arr"+i+"["+n+"+=1];out+='"):"';} } out+='"}).replace(t.evaluate||d,function(e,t){return"';"+m(t)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,""),a&&(t.selfcontained||!l||l._encodeHTML||(l._encodeHTML=u.encodeHTMLSource(t.doNotSkipEncoded)),s="var encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : ("+u.encodeHTMLSource.toString()+"("+(t.doNotSkipEncoded||"")+"));"+s);try{return new Function(t.varname,s)}catch(e){throw"undefined"!=typeof console&&console.log("Could not create a template function: "+s),e}},u.compile=function(e,t){return u.template(e,null,t)}}();var s=o.doT;return delete o.doT,i&&(o.doT=i),s}();T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function g(t,r){"use strict";if(t=t||function(){},r=r||axe.log,!axe._audit)throw new Error("No audit configured");var a=axe.utils.queue(),n=[];Object.keys(axe.plugins).forEach(function(e){a.defer(function(t){var r=function(e){n.push(e),t()};try{axe.plugins[e].cleanup(t,r)}catch(e){r(e)}})});var e=axe.utils.getFlattenedTree(document.body);axe.utils.querySelectorAll(e,"iframe, frame").forEach(function(r){a.defer(function(e,t){return axe.utils.sendCommandToFrame(r.actualNode,{command:"cleanup-plugin"},e,t)})}),a.then(function(e){0===n.length?t(e):r(n)}).catch(r)}function b(e,t,r){"use strict";var a=r,n=function(e){e instanceof Error==!1&&(e=new Error(e)),r(e)},o=e&&e.context||{};o.hasOwnProperty("include")&&!o.include.length&&(o.include=[document]);var i=e&&e.options||{};switch(e.command){case"rules":return x(o,i,function(e,t){a(e),t()},n);case"cleanup-plugin":return g(a,n);default:if(axe._audit&&axe._audit.commands&&axe._audit.commands[e.command])return axe._audit.commands[e.command](e,r)}}function y(e){"use strict";this._run=e.run,this._collect=e.collect,this._registry={},e.commands.forEach(function(e){axe._audit.registerCommand(e)})}axe.log=function(){"use strict";"object"===("undefined"==typeof console?"undefined":T(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},axe.cleanup=g,axe.configure=function(e){"use strict";var t;if(!(t=axe._audit))throw new Error("No audit configured");e.reporter&&("function"==typeof e.reporter||w[e.reporter])&&(t.reporter=e.reporter),e.checks&&e.checks.forEach(function(e){t.addCheck(e)});var r=[];e.rules&&e.rules.forEach(function(e){r.push(e.id),t.addRule(e)}),e.disableOtherRules&&t.rules.forEach(function(e){!1===r.includes(e.id)&&(e.enabled=!1)}),void 0!==e.branding?t.setBranding(e.branding):t._constructHelpUrls(),e.tagExclude&&(t.tagExclude=e.tagExclude),e.locale&&t.applyLocale(e.locale)},axe.getRules=function(e){"use strict";var t=(e=e||[]).length?axe._audit.rules.filter(function(t){return!!e.filter(function(e){return-1!==t.tags.indexOf(e)}).length}):axe._audit.rules,r=axe._audit.data.rules||{};return t.map(function(e){var t=r[e.id]||{};return{ruleId:e.id,description:t.description,help:t.help,helpUrl:t.helpUrl,tags:e.tags}})},axe._load=function(e){"use strict";axe.utils.respondable.subscribe("axe.ping",function(e,t,r){r({axe:!0})}),axe.utils.respondable.subscribe("axe.start",b),axe._audit=new r(e)},(axe=axe||{}).plugins={},y.prototype.run=function(){"use strict";return this._run.apply(this,arguments)},y.prototype.collect=function(){"use strict";return this._collect.apply(this,arguments)},y.prototype.cleanup=function(e){"use strict";var r=axe.utils.queue(),a=this;Object.keys(this._registry).forEach(function(t){r.defer(function(e){a._registry[t].cleanup(e)})}),r.then(function(){e()})},y.prototype.add=function(e){"use strict";this._registry[e.id]=e},axe.registerPlugin=function(e){"use strict";axe.plugins[e.id]=new y(e)};var v,w={};function k(){axe._tree=void 0,axe._selectorData=void 0}function x(r,a,n,o){"use strict";try{r=new u(r),axe._tree=r.flatTree,axe._selectorData=axe.utils.getSelectorData(r.flatTree)}catch(e){return k(),o(e)}var e=axe.utils.queue(),i=axe._audit;a.performanceTimer&&axe.utils.performanceTimer.auditStart(),r.frames.length&&!1!==a.iframes&&e.defer(function(e,t){axe.utils.collectResultsFromFrames(r,a,"rules",null,e,t)});var s=void 0;e.defer(function(e,t){a.restoreScroll&&(s=axe.utils.getScrollState()),i.run(r,a,e,t)}),e.then(function(e){try{s&&axe.utils.setScrollState(s),a.performanceTimer&&axe.utils.performanceTimer.auditEnd();var t=axe.utils.mergeResults(e.map(function(e){return{results:e}}));r.initiator&&((t=i.after(t,a)).forEach(axe.utils.publishMetaData),t=t.map(axe.utils.finalizeRuleResult));try{n(t,k)}catch(e){k(),axe.log(e)}}catch(e){k(),o(e)}}).catch(function(e){k(),o(e)})}axe.getReporter=function(e){"use strict";return"string"==typeof e&&w[e]?w[e]:"function"==typeof e?e:v},axe.addReporter=function(e,t,r){"use strict";w[e]=t,r&&(v=t)},axe.reset=function(){"use strict";var e=axe._audit;if(!e)throw new Error("No audit configured");e.resetRulesAndChecks()},axe._runRules=x;T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var E=function(){};function A(e,t,r){"use strict";var a=new TypeError("axe.run arguments are invalid");if(!function(e){switch(!0){case"string"==typeof e:case Array.isArray(e):case Node&&e instanceof Node:case NodeList&&e instanceof NodeList:return!0;case"object"!==(void 0===e?"undefined":T(e)):return!1;case void 0!==e.include:case void 0!==e.exclude:case"number"==typeof e.length:return!0;default:return!1}}(e)){if(void 0!==r)throw a;r=t,t=e,e=document}if("object"!==(void 0===t?"undefined":T(t))){if(void 0!==r)throw a;r=t,t={}}if("function"!=typeof r&&void 0!==r)throw a;return{context:e,options:t,callback:r||E}}axe.run=function(e,n,o){"use strict";if(!axe._audit)throw new Error("No audit configured");var t=A(e,n,o);e=t.context,n=t.options,o=t.callback,n.reporter=n.reporter||axe._audit.reporter||"v1",n.performanceTimer&&axe.utils.performanceTimer.start();var r=void 0,i=E,s=E;return"function"==typeof Promise&&o===E&&(r=new Promise(function(e,t){i=t,s=e})),axe._runRules(e,n,function(e,t){var r=function(e){t();try{o(null,e)}catch(e){axe.log(e)}s(e)};n.performanceTimer&&axe.utils.performanceTimer.end();try{var a=axe.getReporter(n.reporter)(e,n,r);void 0!==a&&r(a)}catch(e){t(),o(e),i(e)}},function(e){o(e),i(e)}),r},i.failureSummary=function(e){"use strict";var r={};return r.none=e.none.concat(e.all),r.any=e.any,Object.keys(r).map(function(e){if(r[e].length){var t=axe._audit.data.failureSummaries[e];return t&&"function"==typeof t.failureMessage?t.failureMessage(r[e].map(function(e){return e.message||""})):void 0}}).filter(function(e){return void 0!==e}).join("\n\n")},i.incompleteFallbackMessage=function(){"use strict";return axe._audit.data.incompleteFallbackMessage()};T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var N=axe.constants.resultGroups;i.processAggregate=function(e,r){var t=axe.utils.aggregateResult(e);return t.timestamp=(new Date).toISOString(),t.url=window.location.href,N.forEach(function(e){r.resultTypes&&!r.resultTypes.includes(e)&&(t[e]||[]).forEach(function(e){Array.isArray(e.nodes)&&0<e.nodes.length&&(e.nodes=[e.nodes[0]])}),t[e]=(t[e]||[]).map(function(t){return t=Object.assign({},t),Array.isArray(t.nodes)&&0<t.nodes.length&&(t.nodes=t.nodes.map(function(e){return"object"===T(e.node)&&(e.html=e.node.source,r.elementRef&&!e.node.fromFrame&&(e.element=e.node.element),(!1!==r.selectors||e.node.fromFrame)&&(e.target=e.node.selector),r.xpath&&(e.xpath=e.node.xpath)),delete e.result,delete e.node,function(t,r){"use strict";["any","all","none"].forEach(function(e){Array.isArray(t[e])&&t[e].filter(function(e){return Array.isArray(e.relatedNodes)}).forEach(function(e){e.relatedNodes=e.relatedNodes.map(function(e){var t={html:e.source};return r.elementRef&&!e.fromFrame&&(t.element=e.element),(!1!==r.selectors||e.fromFrame)&&(t.target=e.selector),r.xpath&&(t.xpath=e.xpath),t})})})}(e,r),e})),N.forEach(function(e){return delete t[e]}),delete t.pageLevel,delete t.result,t})}),t},axe.addReporter("na",function(e,t,r){"use strict";"function"==typeof t&&(r=t,t={});var a=i.processAggregate(e,t);r({violations:a.violations,passes:a.passes,incomplete:a.incomplete,inapplicable:a.inapplicable,timestamp:a.timestamp,url:a.url})}),axe.addReporter("no-passes",function(e,t,r){"use strict";"function"==typeof t&&(r=t,t={}),t.resultTypes=["violations"];var a=i.processAggregate(e,t);r({violations:a.violations,timestamp:a.timestamp,url:a.url})}),axe.addReporter("raw",function(e,t,r){"use strict";"function"==typeof t&&(r=t,t={}),r(e)}),axe.addReporter("v1",function(e,t,r){"use strict";"function"==typeof t&&(r=t,t={});var a=i.processAggregate(e,t);a.violations.forEach(function(e){return e.nodes.forEach(function(e){e.failureSummary=i.failureSummary(e)})}),r({violations:a.violations,passes:a.passes,incomplete:a.incomplete,inapplicable:a.inapplicable,timestamp:a.timestamp,url:a.url})}),axe.addReporter("v2",function(e,t,r){"use strict";"function"==typeof t&&(r=t,t={});var a=i.processAggregate(e,t);r({violations:a.violations,passes:a.passes,incomplete:a.incomplete,inapplicable:a.inapplicable,timestamp:a.timestamp,url:a.url})},!0),axe.utils.aggregate=function(t,e,r){e=e.slice(),r&&e.push(r);var a=e.map(function(e){return t.indexOf(e)}).sort();return t[a.pop()]};var j=axe.constants,z=j.CANTTELL_PRIO,q=j.FAIL_PRIO,S=[];S[axe.constants.PASS_PRIO]=!0,S[axe.constants.CANTTELL_PRIO]=null,S[axe.constants.FAIL_PRIO]=!1;var C=["any","all","none"];function R(r,a){return C.reduce(function(e,t){return e[t]=(r[t]||[]).map(function(e){return a(e,t)}),e},{})}function I(e,t,r){var a=Object.assign({},t);a.nodes=(a[r]||[]).concat(),axe.constants.resultGroups.forEach(function(e){delete a[e]}),e[r].push(a)}axe.utils.aggregateChecks=function(e){var r=Object.assign({},e);R(r,function(e,t){var r=void 0===e.result?-1:S.indexOf(e.result);e.priority=-1!==r?r:axe.constants.CANTTELL_PRIO,"none"===t&&(e.priority===axe.constants.PASS_PRIO?e.priority=axe.constants.FAIL_PRIO:e.priority===axe.constants.FAIL_PRIO&&(e.priority=axe.constants.PASS_PRIO))});var a={all:r.all.reduce(function(e,t){return Math.max(e,t.priority)},0),none:r.none.reduce(function(e,t){return Math.max(e,t.priority)},0),any:r.any.reduce(function(e,t){return Math.min(e,t.priority)},4)%4};r.priority=Math.max(a.all,a.none,a.any);var n=[];return C.forEach(function(t){r[t]=r[t].filter(function(e){return e.priority===r.priority&&e.priority===a[t]}),r[t].forEach(function(e){return n.push(e.impact)})}),[z,q].includes(r.priority)?r.impact=axe.utils.aggregate(axe.constants.impact,n):r.impact=null,R(r,function(e){delete e.result,delete e.priority}),r.result=axe.constants.results[r.priority],delete r.priority,r},axe.utils.aggregateNodeResults=function(e){var r={};if((e=e.map(function(e){if(e.any&&e.all&&e.none)return axe.utils.aggregateChecks(e);if(Array.isArray(e.node))return axe.utils.finalizeRuleResult(e);throw new TypeError("Invalid Result type")}))&&e.length){var t=e.map(function(e){return e.result});r.result=axe.utils.aggregate(axe.constants.results,t,r.result)}else r.result="inapplicable";axe.constants.resultGroups.forEach(function(e){return r[e]=[]}),e.forEach(function(e){var t=axe.constants.resultGroupMap[e.result];r[t].push(e)});var a=axe.constants.FAIL_GROUP;if(0===r[a].length&&(a=axe.constants.CANTTELL_GROUP),0<r[a].length){var n=r[a].map(function(e){return e.impact});r.impact=axe.utils.aggregate(axe.constants.impact,n)||null}else r.impact=null;return r},axe.utils.aggregateResult=function(e){var r={};return axe.constants.resultGroups.forEach(function(e){return r[e]=[]}),e.forEach(function(t){t.error?I(r,t,axe.constants.CANTTELL_GROUP):t.result===axe.constants.NA?I(r,t,axe.constants.NA_GROUP):axe.constants.resultGroups.forEach(function(e){Array.isArray(t[e])&&0<t[e].length&&I(r,t,e)})}),r},axe.utils.areStylesSet=function e(t,r,a){"use strict";var n=window.getComputedStyle(t,null),o=!1;return!!n&&(r.forEach(function(e){n.getPropertyValue(e.property)===e.value&&(o=!0)}),!!o||!(t.nodeName.toUpperCase()===a.toUpperCase()||!t.parentNode)&&e(t.parentNode,r,a))},axe.utils.checkHelper=function(t,r,a,n){"use strict";return{isAsync:!1,async:function(){return this.isAsync=!0,function(e){e instanceof Error==!1?(t.result=e,a(t)):n(e)}},data:function(e){t.data=e},relatedNodes:function(e){e=e instanceof Node?[e]:axe.utils.toArray(e),t.relatedNodes=e.map(function(e){return new axe.utils.DqElement(e,r)})}}};T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function O(e,t){"use strict";var r;return axe._tree&&(r=axe.utils.getSelector(t)),new Error(e+": "+(r||t))}function L(e,t,r){var a,n;this._fromFrame=!!r,this.spec=r||{},t&&t.absolutePaths&&(this._options={toRoot:!0}),this.source=void 0!==this.spec.source?this.spec.source:((n=(a=e).outerHTML)||"function"!=typeof XMLSerializer||(n=(new XMLSerializer).serializeToString(a)),function(e,t){if(t=t||300,e.length>t){var r=e.indexOf(">");e=e.substring(0,r+1)}return e}(n||"")),this._element=e}axe.utils.clone=function(e){"use strict";var t,r,a=e;if(null!==e&&"object"===(void 0===e?"undefined":T(e)))if(Array.isArray(e))for(a=[],t=0,r=e.length;t<r;t++)a[t]=axe.utils.clone(e[t]);else for(t in a={},e)a[t]=axe.utils.clone(e[t]);return a},axe.utils.sendCommandToFrame=function(t,r,a,n){"use strict";var o=t.contentWindow;if(!o)return axe.log("Frame does not have a content window",t),void a(null);var i=setTimeout(function(){i=setTimeout(function(){r.debug?n(O("No response from frame",t)):a(null)},0)},500);axe.utils.respondable(o,"axe.ping",null,void 0,function(){clearTimeout(i);var e=r.options&&r.options.frameWaitTime||6e4;i=setTimeout(function(){n(O("Axe in frame timed out",t))},e),axe.utils.respondable(o,"axe.start",r,void 0,function(e){clearTimeout(i),e instanceof Error==!1?a(e):n(e)})})},axe.utils.collectResultsFromFrames=function(e,t,r,o,a,n){"use strict";var i=axe.utils.queue();e.frames.forEach(function(a){var n={options:t,command:r,parameter:o,context:{initiator:!1,page:e.page,include:a.include||[],exclude:a.exclude||[]}};i.defer(function(t,e){var r=a.node;axe.utils.sendCommandToFrame(r,n,function(e){if(e)return t({results:e,frameElement:r,frame:axe.utils.getSelector(r)});t(null)},e)})}),i.then(function(e){a(axe.utils.mergeResults(e,t))}).catch(n)},axe.utils.contains=function(e,t){"use strict";return e.shadowId||t.shadowId?function t(e,r){return e.shadowId===r.shadowId||!!e.children.find(function(e){return t(e,r)})}(e,t):"function"==typeof e.actualNode.contains?e.actualNode.contains(t.actualNode):!!(16&e.actualNode.compareDocumentPosition(t.actualNode))},function(axe){function e(){this.pseudos={},this.attrEqualityMods={},this.ruleNestingOperators={},this.substitutesEnabled=!1}function o(e){return"a"<=e&&e<="f"||"A"<=e&&e<="F"||"0"<=e&&e<="9"}e.prototype.registerSelectorPseudos=function(e){for(var t=0,r=arguments.length;t<r;t++)e=arguments[t],this.pseudos[e]="selector";return this},e.prototype.unregisterSelectorPseudos=function(e){for(var t=0,r=arguments.length;t<r;t++)e=arguments[t],delete this.pseudos[e];return this},e.prototype.registerNumericPseudos=function(e){for(var t=0,r=arguments.length;t<r;t++)e=arguments[t],this.pseudos[e]="numeric";return this},e.prototype.unregisterNumericPseudos=function(e){for(var t=0,r=arguments.length;t<r;t++)e=arguments[t],delete this.pseudos[e];return this},e.prototype.registerNestingOperators=function(e){for(var t=0,r=arguments.length;t<r;t++)e=arguments[t],this.ruleNestingOperators[e]=!0;return this},e.prototype.unregisterNestingOperators=function(e){for(var t=0,r=arguments.length;t<r;t++)e=arguments[t],delete this.ruleNestingOperators[e];return this},e.prototype.registerAttrEqualityMods=function(e){for(var t=0,r=arguments.length;t<r;t++)e=arguments[t],this.attrEqualityMods[e]=!0;return this},e.prototype.unregisterAttrEqualityMods=function(e){for(var t=0,r=arguments.length;t<r;t++)e=arguments[t],delete this.attrEqualityMods[e];return this},e.prototype.enableSubstitutes=function(){return this.substitutesEnabled=!0,this},e.prototype.disableSubstitutes=function(){return this.substitutesEnabled=!1,this};var s={"!":!0,'"':!0,"#":!0,$:!0,"%":!0,"&":!0,"'":!0,"(":!0,")":!0,"*":!0,"+":!0,",":!0,".":!0,"/":!0,";":!0,"<":!0,"=":!0,">":!0,"?":!0,"@":!0,"[":!0,"\\":!0,"]":!0,"^":!0,"`":!0,"{":!0,"|":!0,"}":!0,"~":!0},i={"\n":"\\n","\r":"\\r","\t":"\\t","\f":"\\f","\v":"\\v"},y={n:"\n",r:"\r",t:"\t",f:"\f","\\":"\\","'":"'"},v={n:"\n",r:"\r",t:"\t",f:"\f","\\":"\\",'"':'"'};function t(l,u,c,d,n,m){var p,f,h,g,b;return g=l.length,p=null,h=function(e,t){var r,a,n;for(n="",u++,p=l.charAt(u);u<g;){if(p===e)return u++,n;if("\\"===p)if(u++,(p=l.charAt(u))===e)n+=e;else if(r=t[p])n+=r;else{if(o(p)){for(a=p,u++,p=l.charAt(u);o(p);)a+=p,u++,p=l.charAt(u);" "===p&&(u++,p=l.charAt(u)),n+=String.fromCharCode(parseInt(a,16));continue}n+=p}else n+=p;u++,p=l.charAt(u)}return n},f=function(){var e,t="";for(p=l.charAt(u);u<g;){if("a"<=(e=p)&&e<="z"||"A"<=e&&e<="Z"||"0"<=e&&e<="9"||"-"===e||"_"===e)t+=p;else{if("\\"!==p)return t;if(g<=++u)throw Error("Expected symbol but end of file reached.");if(p=l.charAt(u),s[p])t+=p;else{if(o(p)){var r=p;for(u++,p=l.charAt(u);o(p);)r+=p,u++,p=l.charAt(u);" "===p&&(u++,p=l.charAt(u)),t+=String.fromCharCode(parseInt(r,16));continue}t+=p}}u++,p=l.charAt(u)}return t},b=function(){p=l.charAt(u);for(var e=!1;" "===p||"\t"===p||"\n"===p||"\r"===p||"\f"===p;)e=!0,u++,p=l.charAt(u);return e},this.parse=function(){var e=this.parseSelector();if(u<g)throw Error('Rule expected but "'+l.charAt(u)+'" found.');return e},this.parseSelector=function(){var e,t=e=this.parseSingleSelector();for(p=l.charAt(u);","===p;){if(u++,b(),"selectors"!==e.type&&(e={type:"selectors",selectors:[t]}),!(t=this.parseSingleSelector()))throw Error('Rule expected after ",".');e.selectors.push(t)}return e},this.parseSingleSelector=function(){b();var e={type:"ruleSet"},t=this.parseRule();if(!t)return null;for(var r=e;t&&(t.type="rule",r.rule=t,r=t,b(),p=l.charAt(u),!(g<=u||","===p||")"===p));)if(n[p]){var a=p;if(u++,b(),!(t=this.parseRule()))throw Error('Rule expected after "'+a+'".');t.nestingOperator=a}else(t=this.parseRule())&&(t.nestingOperator=null);return e},this.parseRule=function(){for(var e,t=null;u<g;)if("*"===(p=l.charAt(u)))u++,(t=t||{}).tagName="*";else if("a"<=(e=p)&&e<="z"||"A"<=e&&e<="Z"||"-"===e||"_"===e||"\\"===p)(t=t||{}).tagName=f();else if("."===p)u++,((t=t||{}).classNames=t.classNames||[]).push(f());else if("#"===p)u++,(t=t||{}).id=f();else if("["===p){u++,b();var r={name:f()};if(b(),"]"===p)u++;else{var a="";if(d[p]&&(a=p,u++,p=l.charAt(u)),g<=u)throw Error('Expected "=" but end of file reached.');if("="!==p)throw Error('Expected "=" but "'+p+'" found.');r.operator=a+"=",u++,b();var n="";if(r.valueType="string",'"'===p)n=h('"',v);else if("'"===p)n=h("'",y);else if(m&&"$"===p)u++,n=f(),r.valueType="substitute";else{for(;u<g&&"]"!==p;)n+=p,u++,p=l.charAt(u);n=n.trim()}if(b(),g<=u)throw Error('Expected "]" but end of file reached.');if("]"!==p)throw Error('Expected "]" but "'+p+'" found.');u++,r.value=n}((t=t||{}).attrs=t.attrs||[]).push(r)}else{if(":"!==p)break;u++;var o=f(),i={name:o};if("("===p){u++;var s="";if(b(),"selector"===c[o])i.valueType="selector",s=this.parseSelector();else{if(i.valueType=c[o]||"string",'"'===p)s=h('"',v);else if("'"===p)s=h("'",y);else if(m&&"$"===p)u++,s=f(),i.valueType="substitute";else{for(;u<g&&")"!==p;)s+=p,u++,p=l.charAt(u);s=s.trim()}b()}if(g<=u)throw Error('Expected ")" but end of file reached.');if(")"!==p)throw Error('Expected ")" but "'+p+'" found.');u++,i.value=s}((t=t||{}).pseudos=t.pseudos||[]).push(i)}return t},this}e.prototype.parse=function(e){return new t(e,0,this.pseudos,this.attrEqualityMods,this.ruleNestingOperators,this.substitutesEnabled).parse()},e.prototype.escapeIdentifier=function(e){for(var t="",r=0,a=e.length;r<a;){var n=e.charAt(r);if(s[n])t+="\\"+n;else if("_"===n||"-"===n||"A"<=n&&n<="Z"||"a"<=n&&n<="z"||0!==r&&"0"<=n&&n<="9")t+=n;else{var o=n.charCodeAt(0);if(55296==(63488&o)){var i=e.charCodeAt(r++);if(55296!=(64512&o)||56320!=(64512&i))throw Error("UCS-2(decode): illegal sequence");o=((1023&o)<<10)+(1023&i)+65536}t+="\\"+o.toString(16)+" "}r++}return t},e.prototype.escapeStr=function(e){for(var t,r,a="",n=0,o=e.length;n<o;)'"'===(t=e.charAt(n))?t='\\"':"\\"===t?t="\\\\":(r=i[t])&&(t=r),a+=t,n++;return'"'+a+'"'},e.prototype.render=function(e){return this._renderEntity(e).trim()},e.prototype._renderEntity=function(e){var t,r,a;switch(a="",e.type){case"ruleSet":for(t=e.rule,r=[];t;)t.nestingOperator&&r.push(t.nestingOperator),r.push(this._renderEntity(t)),t=t.rule;a=r.join(" ");break;case"selectors":a=e.selectors.map(this._renderEntity,this).join(", ");break;case"rule":e.tagName&&(a="*"===e.tagName?"*":this.escapeIdentifier(e.tagName)),e.id&&(a+="#"+this.escapeIdentifier(e.id)),e.classNames&&(a+=e.classNames.map(function(e){return"."+this.escapeIdentifier(e)},this).join("")),e.attrs&&(a+=e.attrs.map(function(e){return e.operator?"substitute"===e.valueType?"["+this.escapeIdentifier(e.name)+e.operator+"$"+e.value+"]":"["+this.escapeIdentifier(e.name)+e.operator+this.escapeStr(e.value)+"]":"["+this.escapeIdentifier(e.name)+"]"},this).join("")),e.pseudos&&(a+=e.pseudos.map(function(e){return e.valueType?"selector"===e.valueType?":"+this.escapeIdentifier(e.name)+"("+this._renderEntity(e.value)+")":"substitute"===e.valueType?":"+this.escapeIdentifier(e.name)+"($"+e.value+")":"numeric"===e.valueType?":"+this.escapeIdentifier(e.name)+"("+e.value+")":":"+this.escapeIdentifier(e.name)+"("+this.escapeIdentifier(e.value)+")":":"+this.escapeIdentifier(e.name)},this).join(""));break;default:throw Error('Unknown entity type: "'+e.type(NaN))}return a};var r=new e;r.registerNestingOperators(">"),axe.utils.cssParser=r}(axe),L.prototype={get selector(){return this.spec.selector||[axe.utils.getSelector(this.element,this._options)]},get xpath(){return this.spec.xpath||[axe.utils.getXpath(this.element)]},get element(){return this._element},get fromFrame(){return this._fromFrame},toJSON:function(){"use strict";return{selector:this.selector,source:this.source,xpath:this.xpath}}},L.fromFrame=function(e,t,r){return e.selector.unshift(r.selector),e.xpath.unshift(r.xpath),new axe.utils.DqElement(r.element,t,e)},axe.utils.DqElement=L,axe.utils.matchesSelector=function(){"use strict";var r;return function(e,t){return r&&e[r]||(r=function(e){var t,r,a=["matches","matchesSelector","mozMatchesSelector","webkitMatchesSelector","msMatchesSelector"],n=a.length;for(t=0;t<n;t++)if(e[r=a[t]])return r}(e)),e[r](t)}}(),axe.utils.escapeSelector=function(e){"use strict";for(var t,r=String(e),a=r.length,n=-1,o="",i=r.charCodeAt(0);++n<a;)0!=(t=r.charCodeAt(n))?o+=1<=t&&t<=31||127==t||0==n&&48<=t&&t<=57||1==n&&48<=t&&t<=57&&45==i?"\\"+t.toString(16)+" ":(0!=n||1!=a||45!=t)&&(128<=t||45==t||95==t||48<=t&&t<=57||65<=t&&t<=90||97<=t&&t<=122)?r.charAt(n):"\\"+r.charAt(n):o+="�";return o},axe.utils.extendMetaData=function(t,r){Object.assign(t,r),Object.keys(r).filter(function(e){return"function"==typeof r[e]}).forEach(function(e){t[e]=null;try{t[e]=r[e](t)}catch(e){}})},axe.utils.finalizeRuleResult=function(e){return Object.assign(e,axe.utils.aggregateNodeResults(e.nodes)),delete e.nodes,e};var axe;T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,t){return{shadowId:t,children:[],actualNode:e}}axe.utils.findBy=function(e,t,r){if(Array.isArray(e))return e.find(function(e){return"object"===(void 0===e?"undefined":T(e))&&e[t]===r})},(axe=axe||{utils:{}}).utils.getFlattenedTree=function(e,a){var t,r,n;function o(e,t){var r=axe.utils.getFlattenedTree(t,a);return r&&(e=e.concat(r)),e}if(e.documentElement&&(e=e.documentElement),n=e.nodeName.toLowerCase(),axe.utils.isShadowRoot(e))return t=P(e,a),a="a"+Math.random().toString().substring(2),r=Array.from(e.shadowRoot.childNodes),t.children=r.reduce(o,[]),[t];if("content"===n)return(r=Array.from(e.getDistributedNodes())).reduce(o,[]);if("slot"!==n||"function"!=typeof e.assignedNodes)return 1===e.nodeType?(t=P(e,a),r=Array.from(e.childNodes),t.children=r.reduce(o,[]),[t]):3===e.nodeType?[P(e)]:void 0;(r=Array.from(e.assignedNodes())).length||(r=function(e){var t=[];for(e=e.firstChild;e;)t.push(e),e=e.nextSibling;return t}(e));window.getComputedStyle(e);return r.reduce(o,[])},axe.utils.getNodeFromTree=function(e,r){var a;return e.actualNode===r?e:(e.children.forEach(function(e){var t;e.actualNode===r?a=e:(t=axe.utils.getNodeFromTree(e,r))&&(a=t)}),a)},axe.utils.getAllChecks=function(e){"use strict";return[].concat(e.any||[]).concat(e.all||[]).concat(e.none||[])},axe.utils.getCheckOption=function(e,t,r){var a=((r.rules&&r.rules[t]||{}).checks||{})[e.id],n=(r.checks||{})[e.id],o=e.enabled,i=e.options;return n&&(n.hasOwnProperty("enabled")&&(o=n.enabled),n.hasOwnProperty("options")&&(i=n.options)),a&&(a.hasOwnProperty("enabled")&&(o=a.enabled),a.hasOwnProperty("options")&&(i=a.options)),{enabled:o,options:i,absolutePaths:r.absolutePaths}};var U=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],a=!0,n=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(a=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);a=!0);}catch(e){n=!0,o=e}finally{try{!a&&s.return&&s.return()}finally{if(n)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function F(e,t){return[e.substring(0,t),e.substring(t)]}function _(e){return e.replace(/\s+$/,"")}axe.utils.getFriendlyUriEnd=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!(e.length<=1||"data:"===e.substr(0,5)||"javascript:"===e.substr(0,11)||e.includes("?"))){var r=t.currentDomain,a=t.maxLength,n=void 0===a?25:a,o=function(e){var t=e,r="",a="",n="",o="",i="";if(e.includes("#")){var s=F(e,e.indexOf("#")),l=U(s,2);e=l[0],i=l[1]}if(e.includes("?")){var u=F(e,e.indexOf("?")),c=U(u,2);e=c[0],o=c[1]}if(e.includes("://")){var d=e.split("://"),m=U(d,2);r=m[0];var p=F(e=m[1],e.indexOf("/")),f=U(p,2);a=f[0],e=f[1]}else if("//"===e.substr(0,2)){var h=F(e=e.substr(2),e.indexOf("/")),g=U(h,2);a=g[0],e=g[1]}if("www."===a.substr(0,4)&&(a=a.substr(4)),a&&a.includes(":")){var b=F(a,a.indexOf(":")),y=U(b,2);a=y[0],n=y[1]}return{original:t,protocol:r,domain:a,port:n,path:e,query:o,hash:i}}(e),i=o.path,s=o.domain,l=o.hash,u=i.substr(i.substr(0,i.length-2).lastIndexOf("/")+1);if(l)return u&&(u+l).length<=n?_(u+l):u.length<2&&2<l.length&&l.length<=n?_(l):void 0;if(s&&s.length<n&&i.length<=1)return _(s+i);if(i==="/"+u&&s&&r&&s!==r&&(s+i).length<=n)return _(s+i);var c=u.lastIndexOf(".");return(-1===c||1<c)&&(-1!==c||2<u.length)&&u.length<=n&&!u.match(/index(\.[a-zA-Z]{2-4})?/)&&!function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return 0!==e.length&&(e.match(/[0-9]/g)||"").length>=e.length/2}(u)?_(u):void 0}},axe.utils.getRootNode=function(e){var t=e.getRootNode&&e.getRootNode()||document;return t===e&&(t=document),t};var H,D=axe.utils.escapeSelector,M=void 0,V=["class","style","id","selected","checked","disabled","tabindex","aria-checked","aria-selected","aria-invalid","aria-activedescendant","aria-busy","aria-disabled","aria-expanded","aria-grabbed","aria-pressed","aria-valuenow"],B=31;function G(e,t){var r=t.name,a=void 0;if(-1!==r.indexOf("href")||-1!==r.indexOf("src")){var n=axe.utils.getFriendlyUriEnd(e.getAttribute(r));if(n){var o=encodeURI(n);if(!o)return;a=D(t.name)+'$="'+o+'"'}else a=D(t.name)+'="'+e.getAttribute(r)+'"'}else a=D(r)+'="'+D(t.value)+'"';return a}function Y(e,t){return e.count<t.count?-1:e.count===t.count?0:1}function W(e){return!V.includes(e.name)&&-1===e.name.indexOf(":")&&(!e.value||e.value.length<B)}function $(t,r){var e=t.parentNode&&Array.from(t.parentNode.children||"")||[];return e.find(function(e){return e!==t&&axe.utils.matchesSelector(e,r)})?":nth-child("+(1+e.indexOf(t))+")":""}function X(e){if(e.getAttribute("id")){var t=e.getRootNode&&e.getRootNode()||document,r="#"+D(e.getAttribute("id")||"");return r.match(/player_uid_/)||1!==t.querySelectorAll(r).length?void 0:r}}function K(e){return void 0===M&&(M=axe.utils.isXHTML(document)),D(M?e.localName:e.nodeName.toLowerCase())}function J(e,t){var r,a,n,o,i,s,l,u,c,d,m="",p=void 0,f=(r=e,n=[],o=(a=t).classes,i=a.tags,r.classList&&Array.from(r.classList).forEach(function(e){var t=D(e);o[t]<i[r.nodeName]&&n.push({name:t,count:o[t],species:"class"})}),n.sort(Y)),h=(s=e,u=[],c=(l=t).attributes,d=l.tags,s.attributes&&Array.from(s.attributes).filter(W).forEach(function(e){var t=G(s,e);t&&c[t]<d[s.nodeName]&&u.push({name:t,count:c[t],species:"attribute"})}),u.sort(Y));return f.length&&1===f[0].count?p=[f[0]]:h.length&&1===h[0].count?(p=[h[0]],m=K(e)):((p=f.concat(h)).sort(Y),(p=p.slice(0,3)).some(function(e){return"class"===e.species})?p.sort(function(e,t){return e.species!==t.species&&"class"===e.species?-1:e.species===t.species?0:1}):m=K(e)),m+p.reduce(function(e,t){switch(t.species){case"class":return e+"."+t.name;case"attribute":return e+"["+t.name+"]"}return e},"")}function Z(e,t,r){if(!axe._selectorData)throw new Error("Expect axe._selectorData to be set up");var a=t.toRoot,n=void 0!==a&&a,o=void 0,i=void 0;do{var s=X(e);s||(s=J(e,axe._selectorData),s+=$(e,s)),o=o?s+" > "+o:s,i=i?i.filter(function(e){return axe.utils.matchesSelector(e,o)}):Array.from(r.querySelectorAll(o)),e=e.parentElement}while((1<i.length||n)&&e&&11!==e.nodeType);return 1===i.length?o:-1!==o.indexOf(" > ")?":root"+o.substring(o.indexOf(" > ")):":root"}axe.utils.getSelectorData=function(e){for(var a={classes:{},tags:{},attributes:{}},n=(e=Array.isArray(e)?e:[e]).slice(),o=[],t=function(){var e=n.pop(),r=e.actualNode;if(r.querySelectorAll){var t=r.nodeName;a.tags[t]?a.tags[t]++:a.tags[t]=1,r.classList&&Array.from(r.classList).forEach(function(e){var t=D(e);a.classes[t]?a.classes[t]++:a.classes[t]=1}),r.attributes&&Array.from(r.attributes).filter(W).forEach(function(e){var t=G(r,e);t&&(a.attributes[t]?a.attributes[t]++:a.attributes[t]=1)})}for(e.children.length&&(o.push(n),n=e.children.slice());!n.length&&o.length;)n=o.pop()};n.length;)t();return a},axe.utils.getSelector=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";var r=e.getRootNode&&e.getRootNode()||document;if(11!==r.nodeType)return Z(e,t,r);for(var a=[];11===r.nodeType;)a.push({elm:e,doc:r}),r=(e=r.host).getRootNode();return a.push({elm:e,doc:r}),a.reverse().map(function(e){return Z(e.elm,t,e.doc)})},axe.utils.getXpath=function(e){var t=function e(t,r){var a,n;if(!t)return[];if(!r&&9===t.nodeType)return r=[{str:"html"}];if(r=r||[],t.parentNode&&t.parentNode!==t&&(r=e(t.parentNode,r)),t.previousSibling){for(n=1,a=t.previousSibling;1===a.nodeType&&a.nodeName===t.nodeName&&n++,a=a.previousSibling;);1===n&&(n=null)}else if(t.nextSibling)for(a=t.nextSibling;1===a.nodeType&&a.nodeName===t.nodeName?(n=1,a=null):(n=null,a=a.previousSibling),a;);if(1===t.nodeType){var o={};o.str=t.nodeName.toLowerCase();var i=t.getAttribute&&axe.utils.escapeSelector(t.getAttribute("id"));i&&1===t.ownerDocument.querySelectorAll("#"+i).length&&(o.id=t.getAttribute("id")),1<n&&(o.count=n),r.push(o)}return r}(e);return t.reduce(function(e,t){return t.id?"/"+t.str+"[@id='"+t.id+"']":e+"/"+t.str+(0<t.count?"["+t.count+"]":"")},"")},axe.utils.injectStyle=function(e){"use strict";if(H&&H.parentNode)return void 0===H.styleSheet?H.appendChild(document.createTextNode(e)):H.styleSheet.cssText+=e,H;if(e){var t=document.head||document.getElementsByTagName("head")[0];return(H=document.createElement("style")).type="text/css",void 0===H.styleSheet?H.appendChild(document.createTextNode(e)):H.styleSheet.cssText=e,t.appendChild(H),H}},axe.utils.isHidden=function(e,t){"use strict";var r;if(9===e.nodeType)return!1;11===e.nodeType&&(e=e.host);var a=window.getComputedStyle(e,null);return!a||!e.parentNode||"none"===a.getPropertyValue("display")||!t&&"hidden"===a.getPropertyValue("visibility")||"true"===e.getAttribute("aria-hidden")||(r=e.assignedSlot?e.assignedSlot:e.parentNode,axe.utils.isHidden(r,!0))};var Q,ee,te,re,ae=["article","aside","blockquote","body","div","footer","h1","h2","h3","h4","h5","h6","header","main","nav","p","section","span"];axe.utils.isShadowRoot=function(e){var t=e.nodeName.toLowerCase();return!(!e.shadowRoot||!/^[a-z][a-z0-9_.-]*-[a-z0-9_.-]*$/.test(t)&&!ae.includes(t))},axe.utils.isXHTML=function(e){"use strict";return!!e.createElement&&"A"===e.createElement("A").localName},axe.utils.mergeResults=function(e,l){"use strict";var u=[];return e.forEach(function(s){var e,t=(e=s)&&e.results?Array.isArray(e.results)?e.results.length?e.results:null:[e.results]:null;t&&t.length&&t.forEach(function(e){var t,r,a,n,o;e.nodes&&s.frame&&(t=e.nodes,r=l,a=s.frameElement,n=s.frame,o={element:a,selector:n,xpath:axe.utils.getXpath(a)},t.forEach(function(e){e.node=axe.utils.DqElement.fromFrame(e.node,r,o);var t=axe.utils.getAllChecks(e);t.length&&t.forEach(function(e){e.relatedNodes=e.relatedNodes.map(function(e){return axe.utils.DqElement.fromFrame(e,r,o)})})}));var i=axe.utils.findBy(u,"id",e.id);i?e.nodes.length&&function(e,t){for(var r,a,n=t[0].node,o=0,i=e.length;o<i;o++)if(a=e[o].node,0<(r=axe.utils.nodeSorter({actualNode:a.element},{actualNode:n.element}))||0===r&&n.selector.length<a.selector.length)return e.splice.apply(e,[o,0].concat(t));e.push.apply(e,t)}(i.nodes,e.nodes):u.push(e)})}),u},axe.utils.nodeSorter=function(e,t){"use strict";return e.actualNode===t.actualNode?0:4&e.actualNode.compareDocumentPosition(t.actualNode)?-1:1},utils.performanceTimer=function(){"use strict";function e(){if(window.performance&&window.performance)return window.performance.now()}var t=null,r=e();return{start:function(){this.mark("mark_axe_start")},end:function(){this.mark("mark_axe_end"),this.measure("axe","mark_axe_start","mark_axe_end"),this.logMeasures("axe")},auditStart:function(){this.mark("mark_audit_start")},auditEnd:function(){this.mark("mark_audit_end"),this.measure("audit_start_to_end","mark_audit_start","mark_audit_end"),this.logMeasures()},mark:function(e){window.performance&&void 0!==window.performance.mark&&window.performance.mark(e)},measure:function(e,t,r){window.performance&&void 0!==window.performance.measure&&window.performance.measure(e,t,r)},logMeasures:function(e){function t(e){axe.log("Measure "+e.name+" took "+e.duration+"ms")}if(window.performance&&void 0!==window.performance.getEntriesByType)for(var r=window.performance.getEntriesByType("measure"),a=0;a<r.length;++a){var n=r[a];if(n.name===e)return void t(n);t(n)}},timeElapsed:function(){return e()-r},reset:function(){t||(t=e()),r=e()}}}(),"function"!=typeof Object.assign&&(Object.assign=function(e){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var a=arguments[r];if(null!=a)for(var n in a)a.hasOwnProperty(n)&&(t[n]=a[n])}return t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var t,r=Object(this),a=r.length>>>0,n=arguments[1],o=0;o<a;o++)if(t=r[o],e.call(n,t,o,r))return t}}),axe.utils.pollyfillElementsFromPoint=function(){if(document.elementsFromPoint)return document.elementsFromPoint;if(document.msElementsFromPoint)return document.msElementsFromPoint;var e,t=((e=document.createElement("x")).style.cssText="pointer-events:auto","auto"===e.style.pointerEvents),s=t?"pointer-events":"visibility",l=t?"none":"hidden",u=document.createElement("style");return u.innerHTML=t?"* { pointer-events: all }":"* { visibility: visible }",function(e,t){var r,a,n,o=[],i=[];for(document.head.appendChild(u);(r=document.elementFromPoint(e,t))&&-1===o.indexOf(r);)o.push(r),i.push({value:r.style.getPropertyValue(s),priority:r.style.getPropertyPriority(s)}),r.style.setProperty(s,l,"important");for(o.indexOf(document.documentElement)<o.length-1&&(o.splice(o.indexOf(document.documentElement),1),o.push(document.documentElement)),a=i.length;n=i[--a];)o[a].style.setProperty(s,n.value?n.value:"",n.priority);return document.head.removeChild(u),o}},"function"==typeof window.addEventListener&&(document.elementsFromPoint=axe.utils.pollyfillElementsFromPoint()),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e){"use strict";var t=Object(this),r=parseInt(t.length,10)||0;if(0===r)return!1;var a,n,o=parseInt(arguments[1],10)||0;for(0<=o?a=o:(a=r+o)<0&&(a=0);a<r;){if(e===(n=t[a])||e!=e&&n!=n)return!0;a++}return!1}}),Array.prototype.some||Object.defineProperty(Array.prototype,"some",{value:function(e){"use strict";if(null==this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof e)throw new TypeError;for(var t=Object(this),r=t.length>>>0,a=2<=arguments.length?arguments[1]:void 0,n=0;n<r;n++)if(n in t&&e.call(a,t[n],n,t))return!0;return!1}}),Array.from||Object.defineProperty(Array,"from",{value:(Q=Object.prototype.toString,ee=function(e){return"function"==typeof e||"[object Function]"===Q.call(e)},te=Math.pow(2,53)-1,re=function(e){var t,r=(t=Number(e),isNaN(t)?0:0!==t&&isFinite(t)?(0<t?1:-1)*Math.floor(Math.abs(t)):t);return Math.min(Math.max(r,0),te)},function(e){var t=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var r,a=1<arguments.length?arguments[1]:void 0;if(void 0!==a){if(!ee(a))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(r=arguments[2])}for(var n,o=re(t.length),i=ee(this)?Object(new this(o)):new Array(o),s=0;s<o;)n=t[s],i[s]=a?void 0===r?a(n,s):a.call(r,n,s):n,s+=1;return i.length=o,i})}),String.prototype.includes||(String.prototype.includes=function(e,t){return"number"!=typeof t&&(t=0),!(t+e.length>this.length)&&-1!==this.indexOf(e,t)}),axe.utils.preloadCssom=function(e){var t,r,a=e.timeout,n=e.treeRoot,o=void 0===n?axe._tree[0]:n,i=axe.utils.uniqueArray((t=o,r=[],axe.utils.querySelectorAllFilter(t,"*",function(e){return!r.includes(e.shadowId)&&(r.push(e.shadowId),!0)}).map(function(e){return{shadowId:e.shadowId,root:axe.utils.getRootNode(e.actualNode)}})),[]),s=axe.utils.queue();if(!i.length)return s;var l=document.implementation.createHTMLDocument();function u(e){var t=e.data,r=e.isExternal,a=e.shadowId,n=e.root,o=l.createElement("style");return o.type="text/css",o.appendChild(l.createTextNode(t)),l.head.appendChild(o),{sheet:o.sheet,isExternal:r,shadowId:a,root:n}}return s.defer(function(t,e){i.reduce(function(e,r){return e.defer(function(e,t){(function(e,n,o){var i=e.root,s=e.shadowId;function l(e){var a=e.resolve,t=e.reject,r=e.url;axe.imports.axios({method:"get",url:r,timeout:n}).then(function(e){var t=e.data,r=o({data:t,isExternal:!0,shadowId:s,root:i});a(r)}).catch(t)}var u=axe.utils.queue(),t=i.styleSheets?Array.from(i.styleSheets):null;if(!t)return u;var r=[];return t.filter(function(e){var t=!1;return e.href&&(r.includes(e.href)?t=!0:r.push(e.href)),!Array.from(e.media).includes("print")&&!t}).forEach(function(r){try{var e=r.cssRules,t=Array.from(e),a=t.filter(function(e){return e.href});if(!a.length)return void u.defer(function(e){return e({sheet:r,isExternal:!1,shadowId:s,root:i})});a.forEach(function(r){u.defer(function(e,t){l({resolve:e,reject:t,url:r.href})})});var n=t.filter(function(e){return!e.href}).reduce(function(e,t){return e.push(t.cssText),e},[]).join();u.defer(function(e){return e(o({data:n,shadowId:s,root:i,isExternal:!1}))})}catch(e){u.defer(function(e,t){l({resolve:e,reject:t,url:r.href})})}},[]),u})(r,a,u).then(e).catch(t)}),e},axe.utils.queue()).then(function(e){t(e.reduce(function(e,t){return e.concat(t)},[]))}).catch(e)}),s};T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};axe.utils.shouldPreload=function(e){return!(!e||!e.preload)&&("boolean"==typeof e.preload?e.preload:"object"===(void 0===(t=e.preload)?"undefined":T(t))&&Array.isArray(t.assets));var t},axe.utils.getPreloadConfig=function(e){var t={assets:axe.constants.preloadAssets,timeout:axe.constants.preloadAssetsTimeout};if("boolean"==typeof e.preload)return t;if(!e.preload.assets.every(function(e){return axe.constants.preloadAssets.includes(e.toLowerCase())}))throw new Error("Requested assets, not supported. Supported assets are: "+axe.constants.preloadAssets.join(", ")+".");return t.assets=axe.utils.uniqueArray(e.preload.assets.map(function(e){return e.toLowerCase()}),[]),e.preload.timeout&&"number"==typeof e.preload.timeout&&!Number.isNaN(e.preload.timeout)&&(t.timeout=e.preload.timeout),t},axe.utils.preload=function(e){var t={cssom:axe.utils.preloadCssom},r=axe.utils.queue();if(!axe.utils.shouldPreload(e))return r;var a=axe.utils.getPreloadConfig(e);return a.assets.forEach(function(o){r.defer(function(n,e){t[o](a).then(function(e){var t,r,a;n((t={},r=o,a=e[0],r in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a,t))}).catch(e)})}),r};T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function ne(n,o){"use strict";return function(e){var t=n[e.id]||{},r=t.messages||{},a=Object.assign({},t);delete a.messages,void 0===e.result?"object"===T(r.incomplete)?a.message=function(){return function(t,r){function a(e){return e.incomplete&&e.incomplete.default?e.incomplete.default:i.incompleteFallbackMessage()}if(!t||!t.missingData)return a(r);try{var e=r.incomplete[t.missingData[0].reason];if(!e)throw new Error;return e}catch(e){return"string"==typeof t.missingData?r.incomplete[t.missingData]:a(r)}}(e.data,r)}:a.message=r.incomplete:a.message=e.result===o?r.pass:r.fail,axe.utils.extendMetaData(e,a)}}axe.utils.publishMetaData=function(e){"use strict";var t=axe._audit.data.checks||{},r=axe._audit.data.rules||{},a=axe.utils.findBy(axe._audit.rules,"id",e.id)||{};e.tags=axe.utils.clone(a.tags||[]);var n=ne(t,!0),o=ne(t,!1);e.nodes.forEach(function(e){e.any.forEach(n),e.all.forEach(n),e.none.forEach(o)}),axe.utils.extendMetaData(e,axe.utils.clone(r[e.id]||{}))};var oe=function(){},ie=function(){};var se,le=(se=/(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g,function(e){return e.replace(se,"\\")}),ue=/\\/g;function ce(e){if(e)return e.map(function(e){var t,r,a=e.name.replace(ue,""),n=(e.value||"").replace(ue,"");switch(e.operator){case"^=":r=new RegExp("^"+le(n));break;case"$=":r=new RegExp(le(n)+"$");break;case"~=":r=new RegExp("(^|\\s)"+le(n)+"(\\s|$)");break;case"|=":r=new RegExp("^"+le(n)+"(-|$)");break;case"=":t=function(e){return n===e};break;case"*=":t=function(e){return e&&e.includes(n)};break;case"!=":t=function(e){return n!==e};break;default:t=function(e){return!!e}}return""===n&&/^[*$^]=$/.test(e.operator)&&(t=function(){return!1}),t||(t=function(e){return e&&r.test(e)}),{key:a,value:n,test:t}})}function de(e){if(e)return e.map(function(e){return{value:e=e.replace(ue,""),regexp:new RegExp("(^|\\s)"+le(e)+"(\\s|$)")}})}function me(e){if(e)return e.map(function(e){var t;return"not"===e.name&&(t=(t=axe.utils.cssParser.parse(e.value)).selectors?t.selectors:[t],t=oe(t)),{name:e.name,expressions:t,value:e.value}})}function pe(e,t,r,a){var n={nodes:e.slice(),anyLevel:t,thisLevel:r,parentShadowId:a};return n.nodes.reverse(),n}function fe(e,t){return c=e.actualNode,d=t[0],1===c.nodeType&&("*"===d.tag||c.nodeName.toLowerCase()===d.tag)&&(l=e.actualNode,!(u=t[0]).classes||u.classes.reduce(function(e,t){return e&&l.className&&l.className.match(t.regexp)},!0))&&(i=e.actualNode,!(s=t[0]).attributes||s.attributes.reduce(function(e,t){var r=i.getAttribute(t.key);return e&&null!==r&&(!t.value||t.test(r))},!0))&&(n=e.actualNode,!(o=t[0]).id||n.id===o.id)&&(r=e,!((a=t[0]).pseudos&&!a.pseudos.reduce(function(e,t){if("not"===t.name)return e&&!ie([r],t.expressions,!1).length;throw new Error("the pseudo selector "+t.name+" has not yet been implemented")},!0)));var r,a,n,o,i,s,l,u,c,d}oe=function(e){return e.map(function(e){for(var t=[],r=e.rule;r;)t.push({tag:r.tagName?r.tagName.toLowerCase():"*",combinator:r.nestingOperator?r.nestingOperator:" ",id:r.id,attributes:ce(r.attrs),classes:de(r.classNames),pseudos:me(r.pseudos)}),r=r.rule;return t})},ie=function(e,t,r,a){for(var n=[],o=pe(Array.isArray(e)?e:[e],t,[],e[0].shadowId),i=[];o.nodes.length;){for(var s=o.nodes.pop(),l=[],u=[],c=o.anyLevel.slice().concat(o.thisLevel),d=!1,m=0;m<c.length;m++){var p=c[m];if(fe(s,p)&&(!p[0].id||s.shadowId===o.parentShadowId))if(1===p.length)d||a&&!a(s)||(i.push(s),d=!0);else{var f=p.slice(1);if(!1===[" ",">"].includes(f[0].combinator))throw new Error("axe.utils.querySelectorAll does not support the combinator: "+p[1].combinator);">"===f[0].combinator?l.push(f):u.push(f)}!o.anyLevel.includes(p)||p[0].id&&s.shadowId!==o.parentShadowId||u.push(p)}for(s.children&&s.children.length&&r&&(n.push(o),o=pe(s.children,u,l,s.shadowId));!o.nodes.length&&n.length;)o=n.pop()}return i},axe.utils.querySelectorAll=function(e,t){return axe.utils.querySelectorAllFilter(e,t)},axe.utils.querySelectorAllFilter=function(e,t,r){e=Array.isArray(e)?e:[e];var a=axe.utils.cssParser.parse(t);return a=a.selectors?a.selectors:[a],a=oe(a),ie(e,a,!0,r)};T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){"use strict";function m(){}function p(e){if("function"!=typeof e)throw new TypeError("Queue methods require functions as arguments")}axe.utils.queue=function(){var t,a=[],n=0,o=0,r=m,i=!1,s=function(e){t=e,setTimeout(function(){null!=t&&axe.log("Uncaught error (of queue)",t)},1)},l=s;function u(t){return function(e){a[t]=e,(o-=1)||r===m||(i=!0,r(a))}}function c(e){return r=m,l(e),a}var d={defer:function(e){if("object"===(void 0===e?"undefined":T(e))&&e.then&&e.catch){var r=e;e=function(e,t){r.then(e).catch(t)}}if(p(e),void 0===t){if(i)throw new Error("Queue already completed");return a.push(e),++o,function(){for(var e=a.length;n<e;n++){var t=a[n];try{t.call(null,u(n),c)}catch(e){c(e)}}}(),d}},then:function(e){if(p(e),r!==m)throw new Error("queue `then` already set");return t||(r=e,o||(i=!0,r(a))),d},catch:function(e){if(p(e),l!==s)throw new Error("queue `catch` already set");return t?(e(t),t=null):l=e,d},abort:c};return d}}();var he;T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function ge(t,e){"use strict";var r,a,n=axe._audit&&axe._audit.tagExclude?axe._audit.tagExclude:[];return e.hasOwnProperty("include")||e.hasOwnProperty("exclude")?(r=e.include||[],r=Array.isArray(r)?r:[r],a=e.exclude||[],a=(a=Array.isArray(a)?a:[a]).concat(n.filter(function(e){return-1===r.indexOf(e)}))):(r=Array.isArray(e)?e:[e],a=n.filter(function(e){return-1===r.indexOf(e)})),!!(r.some(function(e){return-1!==t.tags.indexOf(e)})||0===r.length&&!1!==t.enabled)&&a.every(function(e){return-1===t.tags.indexOf(e)})}function be(e){return Array.from(e.children).reduce(function(e,t){var r=function(e){var t=window.getComputedStyle(e),r="visible"===t.getPropertyValue("overflow-y"),a="visible"===t.getPropertyValue("overflow-x");if(!r&&e.scrollHeight>e.clientHeight||!a&&e.scrollWidth>e.clientWidth)return{elm:e,top:e.scrollTop,left:e.scrollLeft}}(t);return r&&e.push(r),e.concat(be(t))},[])}function ye(e){"use strict";return e.sort(function(e,t){return axe.utils.contains(e,t)?1:-1})[0]}function ve(t,e){"use strict";var r=e.include&&ye(e.include.filter(function(e){return axe.utils.contains(e,t)})),a=e.exclude&&ye(e.exclude.filter(function(e){return axe.utils.contains(e,t)}));return!!(!a&&r||a&&axe.utils.contains(a,r))}function we(e,t){"use strict";var r;if(0===e.length)return t;e.length<t.length&&(r=e,e=t,t=r);for(var a=0,n=t.length;a<n;a++)e.includes(t[a])||e.push(t[a]);return e}!function(e){"use strict";var l={},i={},s=Object.freeze(["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function u(){var e="axeAPI",t="";return void 0!==axe&&axe._audit&&axe._audit.application&&(e=axe._audit.application),void 0!==axe&&(t=axe.version),e+"."+t}function c(e,t,r,a,n,o){var i;r instanceof Error&&(i={name:r.name,message:r.message,stack:r.stack},r=void 0);var s={uuid:a,topic:t,message:r,error:i,_respondable:!0,_source:u(),_keepalive:n};"function"==typeof o&&(l[a]=o),e.postMessage(JSON.stringify(s),"*")}function t(e,t,r,a,n){c(e,t,r,he.v1(),a,n)}function d(a,n,o){return function(e,t,r){c(a,n,e,o,t,r)}}function o(e){var t;if("string"==typeof e){try{t=JSON.parse(e)}catch(e){}var r,a,n,o;if(function(e){if("object"!==(void 0===e?"undefined":T(e))||"string"!=typeof e.uuid||!0!==e._respondable)return!1;var t=u();return e._source===t||"axeAPI.x.y.z"===e._source||"axeAPI.x.y.z"===t}(t))return"object"===T(t.error)?t.error=(r=t.error,a=r.message||"Unknown error occurred",n=s.includes(r.name)?r.name:"Error",o=window[n]||Error,r.stack&&(a+="\n"+r.stack.replace(r.message,"")),new o(a)):t.error=void 0,t}}t.subscribe=function(e,t){i[e]=t},t.isInFrame=function(e){return!!(e=e||window).frameElement},"function"==typeof window.addEventListener&&window.addEventListener("message",function(t){var r=o(t.data);if(r){var a=r.uuid,e=r._keepalive,n=l[a];if(n)n(r.error||r.message,e,d(t.source,r.topic,a)),e||delete l[a];if(!r.error)try{!function(e,t,r){var a=t.topic,n=i[a];if(n){var o=d(e,null,t.uuid);n(t.message,r,o)}}(t.source,r,e)}catch(e){c(t.source,r.topic,e,a,!1)}}},!1),e.respondable=t}(utils),axe.utils.ruleShouldRun=function(e,t,r){"use strict";var a=r.runOnly||{},n=(r.rules||{})[e.id];return!(e.pageLevel&&!t.page)&&("rule"===a.type?-1!==a.values.indexOf(e.id):n&&"boolean"==typeof n.enabled?n.enabled:"tag"===a.type&&a.values?ge(e,a.values):ge(e,[]))},axe.utils.getScrollState=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:window,t=e.document.documentElement;return[void 0!==e.pageXOffset?{elm:e,top:e.pageYOffset,left:e.pageXOffset}:{elm:t,top:t.scrollTop,left:t.scrollLeft}].concat(be(document.body))},axe.utils.setScrollState=function(e){e.forEach(function(e){return function(e,t,r){if(e===window)return e.scroll(t,r);e.scrollTop=t,e.scrollLeft=r}(e.elm,e.top,e.left)})},axe.utils.select=function(e,t){"use strict";var r,a=[];if(axe._selectCache)for(var n=0,o=axe._selectCache.length;n<o;n++){var i=axe._selectCache[n];if(i.selector===e)return i.result}for(var s,l=(s=t,function(e){return ve(e,s)}),u=t.include.reduce(function(e,t){return e.length&&e[e.length-1].actualNode.contains(t.actualNode)||e.push(t),e},[]),c=0;c<u.length;c++)(r=u[c]).actualNode.nodeType===r.actualNode.ELEMENT_NODE&&axe.utils.matchesSelector(r.actualNode,e)&&l(r)&&(a=we(a,[r])),a=we(a,axe.utils.querySelectorAllFilter(r,e,l));return axe._selectCache&&axe._selectCache.push({selector:e,result:a}),a},axe.utils.toArray=function(e){"use strict";return Array.prototype.slice.call(e)},axe.utils.uniqueArray=function(e,t){return e.concat(t).filter(function(e,t,r){return r.indexOf(e)===t})},function(e){var i,t=e.crypto||e.msCrypto;if(!i&&t&&t.getRandomValues){var r=new Uint8Array(16);i=function(){return t.getRandomValues(r),r}}if(!i){var a=new Array(16);i=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}for(var s="function"==typeof e.Buffer?e.Buffer:Array,n=[],o={},l=0;l<256;l++)n[l]=(l+256).toString(16).substr(1),o[n[l]]=l;function p(e,t){var r=t||0,a=n;return a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]}var u=i(),f=[1|u[0],u[1],u[2],u[3],u[4],u[5]],h=16383&(u[6]<<8|u[7]),g=0,b=0;function c(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"==e?new s(16):null,e=null);var n=(e=e||{}).random||(e.rng||i)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var o=0;o<16;o++)t[a+o]=n[o];return t||p(n)}(he=c).v1=function(e,t,r){var a=t&&r||0,n=t||[],o=null!=(e=e||{}).clockseq?e.clockseq:h,i=null!=e.msecs?e.msecs:(new Date).getTime(),s=null!=e.nsecs?e.nsecs:b+1,l=i-g+(s-b)/1e4;if(l<0&&null==e.clockseq&&(o=o+1&16383),(l<0||g<i)&&null==e.nsecs&&(s=0),1e4<=s)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");g=i,h=o;var u=(1e4*(268435455&(i+=122192928e5))+(b=s))%4294967296;n[a++]=u>>>24&255,n[a++]=u>>>16&255,n[a++]=u>>>8&255,n[a++]=255&u;var c=i/4294967296*1e4&268435455;n[a++]=c>>>8&255,n[a++]=255&c,n[a++]=c>>>24&15|16,n[a++]=c>>>16&255,n[a++]=o>>>8|128,n[a++]=255&o;for(var d=e.node||f,m=0;m<6;m++)n[a+m]=d[m];return t||p(n)},he.v4=c,he.parse=function(e,t,r){var a=t&&r||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){n<16&&(t[a+n++]=o[e])});n<16;)t[a+n++]=0;return t},he.unparse=p,he.BufferClass=s}(window);T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};axe._load({data:{rules:{accesskeys:{description:"Ensures every accesskey attribute value is unique",help:"accesskey attribute value must be unique"},"area-alt":{description:"Ensures <area> elements of image maps have alternate text",help:"Active <area> elements must have alternate text"},"aria-allowed-attr":{description:"Ensures ARIA attributes are allowed for an element's role",help:"Elements must only use allowed ARIA attributes"},"aria-allowed-role":{description:"Ensures role attribute has an appropriate value for the element",help:"ARIA role must be appropriate for the element"},"aria-dpub-role-fallback":{description:"Ensures unsupported DPUB roles are only used on elements with implicit fallback roles",help:"Unsupported DPUB ARIA roles should be used on elements with implicit fallback roles"},"aria-hidden-body":{description:"Ensures aria-hidden='true' is not present on the document body.",help:"aria-hidden='true' must not be present on the document body"},"aria-required-attr":{description:"Ensures elements with ARIA roles have all required ARIA attributes",help:"Required ARIA attributes must be provided"},"aria-required-children":{description:"Ensures elements with an ARIA role that require child roles contain them",help:"Certain ARIA roles must contain particular children"},"aria-required-parent":{description:"Ensures elements with an ARIA role that require parent roles are contained by them",help:"Certain ARIA roles must be contained by particular parents"},"aria-roles":{description:"Ensures all elements with a role attribute use a valid value",help:"ARIA roles used must conform to valid values"},"aria-valid-attr-value":{description:"Ensures all ARIA attributes have valid values",help:"ARIA attributes must conform to valid values"},"aria-valid-attr":{description:"Ensures attributes that begin with aria- are valid ARIA attributes",help:"ARIA attributes must conform to valid names"},"audio-caption":{description:"Ensures <audio> elements have captions",help:"<audio> elements must have a captions track"},"autocomplete-valid":{description:"Ensure the autocomplete attribute is correct and suitable for the form field",help:"autocomplete attribute must be used correctly"},blink:{description:"Ensures <blink> elements are not used",help:"<blink> elements are deprecated and must not be used"},"button-name":{description:"Ensures buttons have discernible text",help:"Buttons must have discernible text"},bypass:{description:"Ensures each page has at least one mechanism for a user to bypass navigation and jump straight to the content",help:"Page must have means to bypass repeated blocks"},checkboxgroup:{description:'Ensures related <input type="checkbox"> elements have a group and that the group designation is consistent',help:"Checkbox inputs with the same name attribute value must be part of a group"},"color-contrast":{description:"Ensures the contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds",help:"Elements must have sufficient color contrast"},"css-orientation-lock":{description:"Ensures content is not locked to any specific display orientation, and the content is operable in all display orientations",help:"CSS Media queries are not used to lock display orientation"},"definition-list":{description:"Ensures <dl> elements are structured correctly",help:"<dl> elements must only directly contain properly-ordered <dt> and <dd> groups, <script> or <template> elements"},dlitem:{description:"Ensures <dt> and <dd> elements are contained by a <dl>",help:"<dt> and <dd> elements must be contained by a <dl>"},"document-title":{description:"Ensures each HTML document contains a non-empty <title> element",help:"Documents must have <title> element to aid in navigation"},"duplicate-id-active":{description:"Ensures every id attribute value of active elements is unique",help:"IDs of active elements must be unique"},"duplicate-id-aria":{description:"Ensures every id attribute value used in ARIA and in labels is unique",help:"IDs used in ARIA and labels must be unique"},"duplicate-id":{description:"Ensures every id attribute value is unique",help:"id attribute value must be unique"},"empty-heading":{description:"Ensures headings have discernible text",help:"Headings must not be empty"},"focus-order-semantics":{description:"Ensures elements in the focus order have an appropriate role",help:"Elements in the focus order need a role appropriate for interactive content"},"frame-tested":{description:"Ensures <iframe> and <frame> elements contain the axe-core script",help:"Frames must be tested with axe-core"},"frame-title-unique":{description:"Ensures <iframe> and <frame> elements contain a unique title attribute",help:"Frames must have a unique title attribute"},"frame-title":{description:"Ensures <iframe> and <frame> elements contain a non-empty title attribute",help:"Frames must have title attribute"},"heading-order":{description:"Ensures the order of headings is semantically correct",help:"Heading levels should only increase by one"},"hidden-content":{description:"Informs users about hidden content.",help:"Hidden content on the page cannot be analyzed"},"html-has-lang":{description:"Ensures every HTML document has a lang attribute",help:"<html> element must have a lang attribute"},"html-lang-valid":{description:"Ensures the lang attribute of the <html> element has a valid value",help:"<html> element must have a valid value for the lang attribute"},"html-xml-lang-mismatch":{description:"Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page",help:"HTML elements with lang and xml:lang must have the same base language"},"image-alt":{description:"Ensures <img> elements have alternate text or a role of none or presentation",help:"Images must have alternate text"},"image-redundant-alt":{description:"Ensure button and link text is not repeated as image alternative",help:"Text of buttons and links should not be repeated in the image alternative"},"input-image-alt":{description:'Ensures <input type="image"> elements have alternate text',help:"Image buttons must have alternate text"},"label-title-only":{description:"Ensures that every form element is not solely labeled using the title or aria-describedby attributes",help:"Form elements should have a visible label"},label:{description:"Ensures every form element has a label",help:"Form elements must have labels"},"landmark-banner-is-top-level":{description:"Ensures the banner landmark is at top level",help:"Banner landmark must not be contained in another landmark"},"landmark-contentinfo-is-top-level":{description:"Ensures the contentinfo landmark is at top level",help:"Contentinfo landmark must not be contained in another landmark"},"landmark-main-is-top-level":{description:"Ensures the main landmark is at top level",help:"Main landmark must not be contained in another landmark"},"landmark-no-duplicate-banner":{description:"Ensures the page has at most one banner landmark",help:"Page must not have more than one banner landmark"},"landmark-no-duplicate-contentinfo":{description:"Ensures the page has at most one contentinfo landmark",help:"Page must not have more than one contentinfo landmark"},"landmark-one-main":{description:"Ensures the page has only one main landmark and each iframe in the page has at most one main landmark",help:"Page must have one main landmark"},"layout-table":{description:"Ensures presentational <table> elements do not use <th>, <caption> elements or the summary attribute",help:"Layout tables must not use data table elements"},"link-in-text-block":{description:"Links can be distinguished without relying on color",help:"Links must be distinguished from surrounding text in a way that does not rely on color"},"link-name":{description:"Ensures links have discernible text",help:"Links must have discernible text"},list:{description:"Ensures that lists are structured correctly",help:"<ul> and <ol> must only directly contain <li>, <script> or <template> elements"},listitem:{description:"Ensures <li> elements are used semantically",help:"<li> elements must be contained in a <ul> or <ol>"},marquee:{description:"Ensures <marquee> elements are not used",help:"<marquee> elements are deprecated and must not be used"},"meta-refresh":{description:'Ensures <meta http-equiv="refresh"> is not used',help:"Timed refresh must not exist"},"meta-viewport-large":{description:'Ensures <meta name="viewport"> can scale a significant amount',help:"Users should be able to zoom and scale the text up to 500%"},"meta-viewport":{description:'Ensures <meta name="viewport"> does not disable text scaling and zooming',help:"Zooming and scaling must not be disabled"},"object-alt":{description:"Ensures <object> elements have alternate text",help:"<object> elements must have alternate text"},"p-as-heading":{description:"Ensure p elements are not used to style headings",help:"Bold, italic text and font-size are not used to style p elements as a heading"},"page-has-heading-one":{description:"Ensure that the page, or at least one of its frames contains a level-one heading",help:"Page must contain a level-one heading"},radiogroup:{description:'Ensures related <input type="radio"> elements have a group and that the group designation is consistent',help:"Radio inputs with the same name attribute value must be part of a group"},region:{description:"Ensures all page content is contained by landmarks",help:"All page content must be contained by landmarks"},"scope-attr-valid":{description:"Ensures the scope attribute is used correctly on tables",help:"scope attribute should be used correctly"},"server-side-image-map":{description:"Ensures that server-side image maps are not used",help:"Server-side image maps must not be used"},"skip-link":{description:"Ensure all skip links have a focusable target",help:"The skip-link target should exist and be focusable"},tabindex:{description:"Ensures tabindex attribute values are not greater than 0",help:"Elements should not have tabindex greater than zero"},"table-duplicate-name":{description:"Ensure that tables do not have the same summary and caption",help:"The <caption> element should not contain the same text as the summary attribute"},"table-fake-caption":{description:"Ensure that tables with a caption use the <caption> element.",help:"Data or header cells should not be used to give caption to a data table."},"td-has-header":{description:"Ensure that each non-empty data cell in a large table has one or more table headers",help:"All non-empty td element in table larger than 3 by 3 must have an associated table header"},"td-headers-attr":{description:"Ensure that each cell in a table using the headers refers to another cell in that table",help:"All cells in a table element that use the headers attribute must only refer to other cells of that same table"},"th-has-data-cells":{description:"Ensure that each table header in a data table refers to data cells",help:"All th elements and elements with role=columnheader/rowheader must have data cells they describe"},"valid-lang":{description:"Ensures lang attributes have valid values",help:"lang attribute must have a valid value"},"video-caption":{description:"Ensures <video> elements have captions",help:"<video> elements must have captions"},"video-description":{description:"Ensures <video> elements have audio descriptions",help:"<video> elements must have an audio description track"}},checks:{accesskeys:{impact:"serious",messages:{pass:function(e){return"Accesskey attribute value is unique"},fail:function(e){return"Document has multiple elements with the same accesskey"}}},"non-empty-alt":{impact:"critical",messages:{pass:function(e){return"Element has a non-empty alt attribute"},fail:function(e){return"Element has no alt attribute or the alt attribute is empty"}}},"non-empty-title":{impact:"serious",messages:{pass:function(e){return"Element has a title attribute"},fail:function(e){return"Element has no title attribute or the title attribute is empty"}}},"aria-label":{impact:"serious",messages:{pass:function(e){return"aria-label attribute exists and is not empty"},fail:function(e){return"aria-label attribute does not exist or is empty"}}},"aria-labelledby":{impact:"serious",messages:{pass:function(e){return"aria-labelledby attribute exists and references elements that are visible to screen readers"},fail:function(e){return"aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty"}}},"aria-allowed-attr":{impact:"critical",messages:{pass:function(e){return"ARIA attributes are used correctly for the defined role"},fail:function(e){var t="ARIA attribute"+(e.data&&1<e.data.length?"s are":" is")+" not allowed:",r=e.data;if(r)for(var a=-1,n=r.length-1;a<n;)t+=" "+r[a+=1];return t}}},"aria-allowed-role":{impact:"minor",messages:{pass:function(e){return"ARIA role is allowed for given element"},fail:function(e){return"role"+(e.data&&1<e.data.length?"s":"")+" "+e.data.join(", ")+" "+(e.data&&1<e.data.length?"are":" is")+" not allowed for given element"}}},"implicit-role-fallback":{impact:"moderate",messages:{pass:function(e){return"Element’s implicit ARIA role is an appropriate fallback"},fail:function(e){return"Element’s implicit ARIA role is not a good fallback for the (unsupported) role"}}},"aria-hidden-body":{impact:"critical",messages:{pass:function(e){return"No aria-hidden attribute is present on document body"},fail:function(e){return"aria-hidden=true should not be present on the document body"}}},"aria-required-attr":{impact:"critical",messages:{pass:function(e){return"All required ARIA attributes are present"},fail:function(e){var t="Required ARIA attribute"+(e.data&&1<e.data.length?"s":"")+" not present:",r=e.data;if(r)for(var a=-1,n=r.length-1;a<n;)t+=" "+r[a+=1];return t}}},"aria-required-children":{impact:"critical",messages:{pass:function(e){return"Required ARIA children are present"},fail:function(e){var t="Required ARIA "+(e.data&&1<e.data.length?"children":"child")+" role not present:",r=e.data;if(r)for(var a=-1,n=r.length-1;a<n;)t+=" "+r[a+=1];return t},incomplete:function(e){var t="Expecting ARIA "+(e.data&&1<e.data.length?"children":"child")+" role to be added:",r=e.data;if(r)for(var a=-1,n=r.length-1;a<n;)t+=" "+r[a+=1];return t}}},"aria-required-parent":{impact:"critical",messages:{pass:function(e){return"Required ARIA parent role present"},fail:function(e){var t="Required ARIA parent"+(e.data&&1<e.data.length?"s":"")+" role not present:",r=e.data;if(r)for(var a=-1,n=r.length-1;a<n;)t+=" "+r[a+=1];return t}}},invalidrole:{impact:"critical",messages:{pass:function(e){return"ARIA role is valid"},fail:function(e){return"Role must be one of the valid ARIA roles"}}},abstractrole:{impact:"serious",messages:{pass:function(e){return"Abstract roles are not used"},fail:function(e){return"Abstract roles cannot be directly used"}}},unsupportedrole:{impact:"critical",messages:{pass:function(e){return"ARIA role is supported"},fail:function(e){return"The role used is not widely supported in assistive technologies"}}},"aria-valid-attr-value":{impact:"critical",messages:{pass:function(e){return"ARIA attribute values are valid"},fail:function(e){var t="Invalid ARIA attribute value"+(e.data&&1<e.data.length?"s":"")+":",r=e.data;if(r)for(var a=-1,n=r.length-1;a<n;)t+=" "+r[a+=1];return t}}},"aria-errormessage":{impact:"critical",messages:{pass:function(e){return"Uses a supported aria-errormessage technique"},fail:function(e){var t="aria-errormessage value"+(e.data&&1<e.data.length?"s":"")+" ",r=e.data;if(r)for(var a=-1,n=r.length-1;a<n;)t+=" `"+r[a+=1];return t+="` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)"}}},"aria-valid-attr":{impact:"critical",messages:{pass:function(e){return"ARIA attribute name"+(e.data&&1<e.data.length?"s":"")+" are valid"},fail:function(e){var t="Invalid ARIA attribute name"+(e.data&&1<e.data.length?"s":"")+":",r=e.data;if(r)for(var a=-1,n=r.length-1;a<n;)t+=" "+r[a+=1];return t}}},caption:{impact:"critical",messages:{pass:function(e){return"The multimedia element has a captions track"},incomplete:function(e){return"Check that captions is available for the element"}}},"autocomplete-valid":{impact:"serious",messages:{pass:function(e){return"the autocomplete attribute is correctly formatted"},fail:function(e){return"the autocomplete attribute is incorrectly formatted"}}},"autocomplete-appropriate":{impact:"serious",messages:{pass:function(e){return"the autocomplete value is on an appropriate element"},fail:function(e){return"the autocomplete value is inappropriate for this type of input"}}},"is-on-screen":{impact:"serious",messages:{pass:function(e){return"Element is not visible"},fail:function(e){return"Element is visible"}}},"non-empty-if-present":{impact:"critical",messages:{pass:function(e){var t="Element ";return e.data?t+="has a non-empty value attribute":t+="does not have a value attribute",t},fail:function(e){return"Element has a value attribute and the value attribute is empty"}}},"non-empty-value":{impact:"critical",messages:{pass:function(e){return"Element has a non-empty value attribute"},fail:function(e){return"Element has no value attribute or the value attribute is empty"}}},"button-has-visible-text":{impact:"critical",messages:{pass:function(e){return"Element has inner text that is visible to screen readers"},fail:function(e){return"Element does not have inner text that is visible to screen readers"}}},"role-presentation":{impact:"minor",messages:{pass:function(e){return'Element\'s default semantics were overriden with role="presentation"'},fail:function(e){return'Element\'s default semantics were not overridden with role="presentation"'}}},"role-none":{impact:"minor",messages:{pass:function(e){return'Element\'s default semantics were overriden with role="none"'},fail:function(e){return'Element\'s default semantics were not overridden with role="none"'}}},"focusable-no-name":{impact:"serious",messages:{pass:function(e){return"Element is not in tab order or has accessible text"},fail:function(e){return"Element is in tab order and does not have accessible text"}}},"internal-link-present":{impact:"serious",messages:{pass:function(e){return"Valid skip link found"},fail:function(e){return"No valid skip link found"}}},"header-present":{impact:"serious",messages:{pass:function(e){return"Page has a header"},fail:function(e){return"Page does not have a header"}}},landmark:{impact:"serious",messages:{pass:function(e){return"Page has a landmark region"},fail:function(e){return"Page does not have a landmark region"}}},"group-labelledby":{impact:"critical",messages:{pass:function(e){return'All elements with the name "'+e.data.name+'" reference the same element with aria-labelledby'},fail:function(e){return'All elements with the name "'+e.data.name+'" do not reference the same element with aria-labelledby'}}},fieldset:{impact:"critical",messages:{pass:function(e){return"Element is contained in a fieldset"},fail:function(e){var t="",r=e.data&&e.data.failureCode;return t+="no-legend"===r?"Fieldset does not have a legend as its first child":"empty-legend"===r?"Legend does not have text that is visible to screen readers":"mixed-inputs"===r?"Fieldset contains unrelated inputs":"no-group-label"===r?"ARIA group does not have aria-label or aria-labelledby":"group-mixed-inputs"===r?"ARIA group contains unrelated inputs":"Element does not have a containing fieldset or ARIA group"}}},"color-contrast":{impact:"serious",messages:{pass:function(e){return"Element has sufficient color contrast of "+e.data.contrastRatio},fail:function(e){return"Element has insufficient color contrast of "+e.data.contrastRatio+" (foreground color: "+e.data.fgColor+", background color: "+e.data.bgColor+", font size: "+e.data.fontSize+", font weight: "+e.data.fontWeight+"). Expected contrast ratio of "+e.data.expectedContrastRatio},incomplete:{bgImage:"Element's background color could not be determined due to a background image",bgGradient:"Element's background color could not be determined due to a background gradient",imgNode:"Element's background color could not be determined because element contains an image node",bgOverlap:"Element's background color could not be determined because it is overlapped by another element",fgAlpha:"Element's foreground color could not be determined because of alpha transparency",elmPartiallyObscured:"Element's background color could not be determined because it's partially obscured by another element",elmPartiallyObscuring:"Element's background color could not be determined because it partially overlaps other elements",outsideViewport:"Element's background color could not be determined because it's outside the viewport",equalRatio:"Element has a 1:1 contrast ratio with the background",shortTextContent:"Element content is too short to determine if it is actual text content",default:"Unable to determine contrast ratio"}}},"css-orientation-lock":{impact:"serious",messages:{pass:function(e){return"Display is operable, and orientation lock does not exist"},fail:function(e){return"CSS Orientation lock is applied, and makes display inoperable"}}},"structured-dlitems":{impact:"serious",messages:{pass:function(e){return"When not empty, element has both <dt> and <dd> elements"},fail:function(e){return"When not empty, element does not have at least one <dt> element followed by at least one <dd> element"}}},"only-dlitems":{impact:"serious",messages:{pass:function(e){return"List element only has direct children that are allowed inside <dt> or <dd> elements"},fail:function(e){return"List element has direct children that are not allowed inside <dt> or <dd> elements"}}},dlitem:{impact:"serious",messages:{pass:function(e){return"Description list item has a <dl> parent element"},fail:function(e){return"Description list item does not have a <dl> parent element"}}},"doc-has-title":{impact:"serious",messages:{pass:function(e){return"Document has a non-empty <title> element"},fail:function(e){return"Document does not have a non-empty <title> element"}}},"duplicate-id-active":{impact:"serious",messages:{pass:function(e){return"Document has no active elements that share the same id attribute"},fail:function(e){return"Document has active elements with the same id attribute: "+e.data}}},"duplicate-id-aria":{impact:"critical",messages:{pass:function(e){return"Document has no elements referenced with ARIA or labels that share the same id attribute"},fail:function(e){return"Document has multiple elements referenced with ARIA with the same id attribute: "+e.data}}},"duplicate-id":{impact:"minor",messages:{pass:function(e){return"Document has no static elements that share the same id attribute"},fail:function(e){return"Document has multiple static elements with the same id attribute"}}},"has-visible-text":{impact:"minor",messages:{pass:function(e){return"Element has text that is visible to screen readers"},fail:function(e){return"Element does not have text that is visible to screen readers"}}},"has-widget-role":{impact:"minor",messages:{pass:function(e){return"Element has a widget role."},fail:function(e){return"Element does not have a widget role."}}},"valid-scrollable-semantics":{impact:"minor",messages:{pass:function(e){return"Element has valid semantics for an element in the focus order."},fail:function(e){return"Element has invalid semantics for an element in the focus order."}}},"frame-tested":{impact:"critical",messages:{pass:function(e){return"The iframe was tested with axe-core"},fail:function(e){return"The iframe could not be tested with axe-core"},incomplete:function(e){return"The iframe still has to be tested with axe-core"}}},"unique-frame-title":{impact:"serious",messages:{pass:function(e){return"Element's title attribute is unique"},fail:function(e){return"Element's title attribute is not unique"}}},"heading-order":{impact:"moderate",messages:{pass:function(e){return"Heading order valid"},fail:function(e){return"Heading order invalid"}}},"hidden-content":{impact:"minor",messages:{pass:function(e){return"All content on the page has been analyzed."},fail:function(e){return"There were problems analyzing the content on this page."},incomplete:function(e){return"There is hidden content on the page that was not analyzed. You will need to trigger the display of this content in order to analyze it."}}},"has-lang":{impact:"serious",messages:{pass:function(e){return"The <html> element has a lang attribute"},fail:function(e){return"The <html> element does not have a lang attribute"}}},"valid-lang":{impact:"serious",messages:{pass:function(e){return"Value of lang attribute is included in the list of valid languages"},fail:function(e){return"Value of lang attribute not included in the list of valid languages"}}},"xml-lang-mismatch":{impact:"moderate",messages:{pass:function(e){return"Lang and xml:lang attributes have the same base language"},fail:function(e){return"Lang and xml:lang attributes do not have the same base language"}}},"has-alt":{impact:"critical",messages:{pass:function(e){return"Element has an alt attribute"},fail:function(e){return"Element does not have an alt attribute"}}},"duplicate-img-label":{impact:"minor",messages:{pass:function(e){return"Element does not duplicate existing text in <img> alt text"},fail:function(e){return"Element contains <img> element with alt text that duplicates existing text"}}},"title-only":{impact:"serious",messages:{pass:function(e){return"Form element does not solely use title attribute for its label"},fail:function(e){return"Only title used to generate label for form element"}}},"implicit-label":{impact:"critical",messages:{pass:function(e){return"Form element has an implicit (wrapped) <label>"},fail:function(e){return"Form element does not have an implicit (wrapped) <label>"}}},"explicit-label":{impact:"critical",messages:{pass:function(e){return"Form element has an explicit <label>"},fail:function(e){return"Form element does not have an explicit <label>"}}},"help-same-as-label":{impact:"minor",messages:{pass:function(e){return"Help text (title or aria-describedby) does not duplicate label text"},fail:function(e){return"Help text (title or aria-describedby) text is the same as the label text"}}},"multiple-label":{impact:"serious",messages:{pass:function(e){return"Form element does not have multiple <label> elements"},fail:function(e){return"Form element has multiple <label> elements"}}},"hidden-explicit-label":{impact:"critical",messages:{pass:function(e){return"Form element has a visible explicit <label>"},fail:function(e){return"Form element has explicit <label> that is hidden"}}},"landmark-is-top-level":{impact:"moderate",messages:{pass:function(e){return"The "+e.data.role+" landmark is at the top level."},fail:function(e){return"The "+e.data.role+" landmark is contained in another landmark."}}},"page-no-duplicate-banner":{impact:"moderate",messages:{pass:function(e){return"Document has no more than one banner landmark"},fail:function(e){return"Document has more than one banner landmark"}}},"page-no-duplicate-contentinfo":{impact:"moderate",messages:{pass:function(e){return"Page does not have more than one contentinfo landmark"},fail:function(e){return"Page has more than one contentinfo landmark"}}},"page-has-main":{impact:"moderate",messages:{pass:function(e){return"Page has at least one main landmark"},fail:function(e){return"Page does not have a main landmark"}}},"page-no-duplicate-main":{impact:"moderate",messages:{pass:function(e){return"Page does not have more than one main landmark"},fail:function(e){return"Page has more than one main landmark"}}},"has-th":{impact:"serious",messages:{pass:function(e){return"Layout table does not use <th> elements"},fail:function(e){return"Layout table uses <th> elements"}}},"has-caption":{impact:"serious",messages:{pass:function(e){return"Layout table does not use <caption> element"},fail:function(e){return"Layout table uses <caption> element"}}},"has-summary":{impact:"serious",messages:{pass:function(e){return"Layout table does not use summary attribute"},fail:function(e){return"Layout table uses summary attribute"}}},"link-in-text-block":{impact:"serious",messages:{pass:function(e){return"Links can be distinguished from surrounding text in some way other than by color"},fail:function(e){return"Links need to be distinguished from surrounding text in some way other than by color"},incomplete:{bgContrast:"Element's contrast ratio could not be determined. Check for a distinct hover/focus style",bgImage:"Element's contrast ratio could not be determined due to a background image",bgGradient:"Element's contrast ratio could not be determined due to a background gradient",imgNode:"Element's contrast ratio could not be determined because element contains an image node",bgOverlap:"Element's contrast ratio could not be determined because of element overlap",default:"Unable to determine contrast ratio"}}},"only-listitems":{impact:"serious",messages:{pass:function(e){return"List element only has direct children that are allowed inside <li> elements"},fail:function(e){return"List element has direct children that are not allowed inside <li> elements"}}},listitem:{impact:"serious",messages:{pass:function(e){return'List item has a <ul>, <ol> or role="list" parent element'},fail:function(e){return'List item does not have a <ul>, <ol> or role="list" parent element'}}},"meta-refresh":{impact:"critical",messages:{pass:function(e){return"<meta> tag does not immediately refresh the page"},fail:function(e){return"<meta> tag forces timed refresh of page"}}},"meta-viewport-large":{impact:"minor",messages:{pass:function(e){return"<meta> tag does not prevent significant zooming on mobile devices"},fail:function(e){return"<meta> tag limits zooming on mobile devices"}}},"meta-viewport":{impact:"critical",messages:{pass:function(e){return"<meta> tag does not disable zooming on mobile devices"},fail:function(e){return e.data+" on <meta> tag disables zooming on mobile devices"}}},"p-as-heading":{impact:"serious",messages:{pass:function(e){return"<p> elements are not styled as headings"},fail:function(e){return"Heading elements should be used instead of styled p elements"}}},"page-has-heading-one":{impact:"moderate",messages:{pass:function(e){return"Page has at least one level-one heading"},fail:function(e){return"Page must have a level-one heading"}}},region:{impact:"moderate",messages:{pass:function(e){return"All page content is contained by landmarks"},fail:function(e){return"Some page content is not contained by landmarks"}}},"html5-scope":{impact:"moderate",messages:{pass:function(e){return"Scope attribute is only used on table header elements (<th>)"},fail:function(e){return"In HTML 5, scope attributes may only be used on table header elements (<th>)"}}},"scope-value":{impact:"critical",messages:{pass:function(e){return"Scope attribute is used correctly"},fail:function(e){return"The value of the scope attribute may only be 'row' or 'col'"}}},exists:{impact:"minor",messages:{pass:function(e){return"Element does not exist"},fail:function(e){return"Element exists"}}},"skip-link":{impact:"moderate",messages:{pass:function(e){return"Skip link target exists"},incomplete:function(e){return"Skip link target should become visible on activation"},fail:function(e){return"No skip link target"}}},tabindex:{impact:"serious",messages:{pass:function(e){return"Element does not have a tabindex greater than 0"},fail:function(e){return"Element has a tabindex greater than 0"}}},"same-caption-summary":{impact:"minor",messages:{pass:function(e){return"Content of summary attribute and <caption> are not duplicated"},fail:function(e){return"Content of summary attribute and <caption> element are identical"}}},"caption-faked":{impact:"serious",messages:{pass:function(e){return"The first row of a table is not used as a caption"},fail:function(e){return"The first row of the table should be a caption instead of a table cell"}}},"td-has-header":{impact:"critical",messages:{pass:function(e){return"All non-empty data cells have table headers"},fail:function(e){return"Some non-empty data cells do not have table headers"}}},"td-headers-attr":{impact:"serious",messages:{pass:function(e){return"The headers attribute is exclusively used to refer to other cells in the table"},fail:function(e){return"The headers attribute is not exclusively used to refer to other cells in the table"}}},"th-has-data-cells":{impact:"serious",messages:{pass:function(e){return"All table header cells refer to data cells"},fail:function(e){return"Not all table header cells refer to data cells"},incomplete:function(e){return"Table data cells are missing or empty"}}},description:{impact:"critical",messages:{pass:function(e){return"The multimedia element has an audio description track"},incomplete:function(e){return"Check that audio description is available for the element"}}}},failureSummaries:{any:{failureMessage:function(e){var t="Fix any of the following:",r=e;if(r)for(var a=-1,n=r.length-1;a<n;)t+="\n "+r[a+=1].split("\n").join("\n ");return t}},none:{failureMessage:function(e){var t="Fix all of the following:",r=e;if(r)for(var a=-1,n=r.length-1;a<n;)t+="\n "+r[a+=1].split("\n").join("\n ");return t}}},incompleteFallbackMessage:function(e){return"aXe couldn't tell the reason. Time to break out the element inspector!"}},rules:[{id:"accesskeys",selector:"[accesskey]",excludeHidden:!1,tags:["best-practice","cat.keyboard"],all:[],any:[],none:["accesskeys"]},{id:"area-alt",selector:"map area[href]",excludeHidden:!1,tags:["cat.text-alternatives","wcag2a","wcag111","section508","section508.22.a"],all:[],any:["non-empty-alt","non-empty-title","aria-label","aria-labelledby"],none:[]},{id:"aria-allowed-attr",matches:function(e,t){var r=e.getAttribute("role");r||(r=axe.commons.aria.implicitRole(e));var a=axe.commons.aria.allowedAttr(r);if(r&&a){var n=/^aria-/;if(e.hasAttributes())for(var o=e.attributes,i=0,s=o.length;i<s;i++)if(n.test(o[i].name))return!0}return!1},tags:["cat.aria","wcag2a","wcag412"],all:[],any:["aria-allowed-attr"],none:[]},{id:"aria-allowed-role",excludeHidden:!1,selector:"[role]",tags:["cat.aria","best-practice"],all:[],any:[{options:{allowImplicit:!0,ignoredTags:[]},id:"aria-allowed-role"}],none:[]},{id:"aria-dpub-role-fallback",selector:"[role]",matches:function(e,t){var r=e.getAttribute("role");return["doc-backlink","doc-biblioentry","doc-biblioref","doc-cover","doc-endnote","doc-glossref","doc-noteref"].includes(r)},tags:["cat.aria","wcag2a","wcag131"],all:["implicit-role-fallback"],any:[],none:[]},{id:"aria-hidden-body",selector:"body",excludeHidden:!1,tags:["cat.aria","wcag2a","wcag412"],all:[],any:["aria-hidden-body"],none:[]},{id:"aria-required-attr",selector:"[role]",tags:["cat.aria","wcag2a","wcag412"],all:[],any:["aria-required-attr"],none:[]},{id:"aria-required-children",selector:"[role]",tags:["cat.aria","wcag2a","wcag131"],all:[],any:[{options:{reviewEmpty:["listbox"]},id:"aria-required-children"}],none:[]},{id:"aria-required-parent",selector:"[role]",tags:["cat.aria","wcag2a","wcag131"],all:[],any:["aria-required-parent"],none:[]},{id:"aria-roles",selector:"[role]",tags:["cat.aria","wcag2a","wcag412"],all:[],any:[],none:["invalidrole","abstractrole","unsupportedrole"]},{id:"aria-valid-attr-value",matches:function(e,t){var r=/^aria-/;if(e.hasAttributes())for(var a=e.attributes,n=0,o=a.length;n<o;n++)if(r.test(a[n].name))return!0;return!1},tags:["cat.aria","wcag2a","wcag412"],all:[{options:[],id:"aria-valid-attr-value"},"aria-errormessage"],any:[],none:[]},{id:"aria-valid-attr",matches:function(e,t){var r=/^aria-/;if(e.hasAttributes())for(var a=e.attributes,n=0,o=a.length;n<o;n++)if(r.test(a[n].name))return!0;return!1},tags:["cat.aria","wcag2a","wcag412"],all:[],any:[{options:[],id:"aria-valid-attr"}],none:[]},{id:"audio-caption",selector:"audio",enabled:!1,excludeHidden:!1,tags:["cat.time-and-media","wcag2a","wcag121","section508","section508.22.a"],all:[],any:[],none:["caption"]},{id:"autocomplete-valid",matches:function(e,t){var r=axe.commons,a=r.text,n=r.aria,o=r.dom,i=e.getAttribute("autocomplete");if(!i||""===a.sanitize(i))return!1;var s=e.nodeName.toUpperCase();if(!1===["TEXTAREA","INPUT","SELECT"].includes(s))return!1;if("INPUT"===s&&["submit","reset","button","hidden"].includes(e.type))return!1;var l=e.getAttribute("aria-disabled")||"false";if(e.disabled||"true"===l.toLowerCase())return!1;var u=e.getAttribute("role"),c=e.getAttribute("tabindex");if("-1"===c&&u){var d=n.lookupTable.role[u];if(void 0===d||"widget"!==d.type)return!1}return!("-1"===c&&!o.isVisible(e,!1)&&!o.isVisible(e,!0))},tags:["cat.forms","wcag21aa","wcag135"],all:["autocomplete-valid","autocomplete-appropriate"],any:[],none:[]},{id:"blink",selector:"blink",excludeHidden:!1,tags:["cat.time-and-media","wcag2a","wcag222","section508","section508.22.j"],all:[],any:[],none:["is-on-screen"]},{id:"button-name",selector:'button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]',tags:["cat.name-role-value","wcag2a","wcag412","section508","section508.22.a"],all:[],any:["non-empty-if-present","non-empty-value","button-has-visible-text","aria-label","aria-labelledby","role-presentation","role-none","non-empty-title"],none:["focusable-no-name"]},{id:"bypass",selector:"html",pageLevel:!0,matches:function(e,t){return!!e.querySelector("a[href]")},tags:["cat.keyboard","wcag2a","wcag241","section508","section508.22.o"],all:[],any:["internal-link-present","header-present","landmark"],none:[]},{id:"checkboxgroup",selector:"input[type=checkbox][name]",tags:["cat.forms","best-practice"],all:[],any:["group-labelledby","fieldset"],none:[]},{id:"color-contrast",matches:function(e,t){var r=e.nodeName.toUpperCase(),a=e.type;if("true"===e.getAttribute("aria-disabled")||axe.commons.dom.findUpVirtual(t,'[aria-disabled="true"]'))return!1;if("INPUT"===r)return-1===["hidden","range","color","checkbox","radio","image"].indexOf(a)&&!e.disabled;if("SELECT"===r)return!!e.options.length&&!e.disabled;if("TEXTAREA"===r)return!e.disabled;if("OPTION"===r)return!1;if("BUTTON"===r&&e.disabled||axe.commons.dom.findUpVirtual(t,"button[disabled]"))return!1;if("FIELDSET"===r&&e.disabled||axe.commons.dom.findUpVirtual(t,"fieldset[disabled]"))return!1;var n=axe.commons.dom.findUpVirtual(t,"label");if("LABEL"===r||n){var o=e,i=t;n&&(o=n,i=axe.utils.getNodeFromTree(axe._tree[0],n));var s=axe.commons.dom.getRootNode(o);if((l=o.htmlFor&&s.getElementById(o.htmlFor))&&l.disabled)return!1;if((l=axe.utils.querySelectorAll(i,'input:not([type="hidden"]):not([type="image"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea')).length&&l[0].actualNode.disabled)return!1}if(e.getAttribute("id")){var l,u=axe.commons.utils.escapeSelector(e.getAttribute("id"));if((l=axe.commons.dom.getRootNode(e).querySelector("[aria-labelledby~="+u+"]"))&&l.disabled)return!1}if(""===axe.commons.text.visibleVirtual(t,!1,!0))return!1;var c,d,m=document.createRange(),p=t.children,f=p.length;for(d=0;d<f;d++)3===(c=p[d]).actualNode.nodeType&&""!==axe.commons.text.sanitize(c.actualNode.nodeValue)&&m.selectNodeContents(c.actualNode);var h=m.getClientRects();for(f=h.length,d=0;d<f;d++)if(axe.commons.dom.visuallyOverlaps(h[d],e))return!0;return!1},excludeHidden:!1,options:{noScroll:!1},tags:["cat.color","wcag2aa","wcag143"],all:[],any:["color-contrast"],none:[]},{id:"css-orientation-lock",selector:"html",tags:["cat.structure","wcag262","wcag21aa","experimental"],all:["css-orientation-lock"],any:[],none:[],preload:!0},{id:"definition-list",selector:"dl",matches:function(e,t){return!e.getAttribute("role")},tags:["cat.structure","wcag2a","wcag131"],all:[],any:[],none:["structured-dlitems","only-dlitems"]},{id:"dlitem",selector:"dd, dt",matches:function(e,t){return!e.getAttribute("role")},tags:["cat.structure","wcag2a","wcag131"],all:[],any:["dlitem"],none:[]},{id:"document-title",selector:"html",matches:function(e,t){return e.ownerDocument.defaultView.self===e.ownerDocument.defaultView.top},tags:["cat.text-alternatives","wcag2a","wcag242"],all:[],any:["doc-has-title"],none:[]},{id:"duplicate-id-active",selector:"[id]",matches:function(e,t){var r=axe.commons,a=r.dom,n=r.aria,o=e.getAttribute("id").trim(),i='*[id="'+axe.utils.escapeSelector(o)+'"]';return Array.from(a.getRootNode(e).querySelectorAll(i)).some(a.isFocusable)&&!n.isAccessibleRef(e)},excludeHidden:!1,tags:["cat.parsing","wcag2a","wcag411"],all:[],any:["duplicate-id-active"],none:[]},{id:"duplicate-id-aria",selector:"[id]",matches:function(e,t){return axe.commons.aria.isAccessibleRef(e)},excludeHidden:!1,tags:["cat.parsing","wcag2a","wcag411"],all:[],any:["duplicate-id-aria"],none:[]},{id:"duplicate-id",selector:"[id]",matches:function(e,t){var r=axe.commons,a=r.dom,n=r.aria,o=e.getAttribute("id").trim(),i='*[id="'+axe.utils.escapeSelector(o)+'"]';return Array.from(a.getRootNode(e).querySelectorAll(i)).every(function(e){return!a.isFocusable(e)})&&!n.isAccessibleRef(e)},excludeHidden:!1,tags:["cat.parsing","wcag2a","wcag411"],all:[],any:["duplicate-id"],none:[]},{id:"empty-heading",selector:'h1, h2, h3, h4, h5, h6, [role="heading"]',matches:function(e,t){var r=void 0;return e.hasAttribute("role")&&(r=e.getAttribute("role").split(/\s+/i).filter(axe.commons.aria.isValidRole)),r&&0<r.length?r.includes("heading"):"heading"===axe.commons.aria.implicitRole(e)},tags:["cat.name-role-value","best-practice"],all:[],any:["has-visible-text"],none:[]},{id:"focus-order-semantics",selector:"div, h1, h2, h3, h4, h5, h6, [role=heading], p, span",matches:function(e,t){return axe.commons.dom.insertedIntoFocusOrder(e)},tags:["cat.keyboard","best-practice","experimental"],all:[],any:[{options:[],id:"has-widget-role"},{options:[],id:"valid-scrollable-semantics"}],none:[]},{id:"frame-tested",selector:"frame, iframe",tags:["cat.structure","review-item"],all:[{options:{isViolation:!1},id:"frame-tested"}],any:[],none:[]},{id:"frame-title-unique",selector:"frame[title], iframe[title]",matches:function(e,t){var r=e.getAttribute("title");return!(!r||!axe.commons.text.sanitize(r).trim())},tags:["cat.text-alternatives","best-practice"],all:[],any:[],none:["unique-frame-title"]},{id:"frame-title",selector:"frame, iframe",tags:["cat.text-alternatives","wcag2a","wcag241","wcag412","section508","section508.22.i"],all:[],any:["aria-label","aria-labelledby","non-empty-title","role-presentation","role-none"],none:[]},{id:"heading-order",selector:"h1, h2, h3, h4, h5, h6, [role=heading]",matches:function(e,t){var r=void 0;return e.hasAttribute("role")&&(r=e.getAttribute("role").split(/\s+/i).filter(axe.commons.aria.isValidRole)),r&&0<r.length?r.includes("heading"):"heading"===axe.commons.aria.implicitRole(e)},tags:["cat.semantics","best-practice"],all:[],any:["heading-order"],none:[]},{id:"hidden-content",selector:"*",excludeHidden:!1,tags:["cat.structure","experimental","review-item"],all:[],any:["hidden-content"],none:[]},{id:"html-has-lang",selector:"html",tags:["cat.language","wcag2a","wcag311"],all:[],any:["has-lang"],none:[]},{id:"html-lang-valid",selector:"html[lang]",tags:["cat.language","wcag2a","wcag311"],all:[],any:[],none:["valid-lang"]},{id:"html-xml-lang-mismatch",selector:"html[lang][xml\\:lang]",matches:function(e,t){var r=axe.commons.utils.getBaseLang,a=r(e.getAttribute("lang")),n=r(e.getAttribute("xml:lang"));return axe.utils.validLangs().includes(a)&&axe.utils.validLangs().includes(n)},tags:["cat.language","wcag2a","wcag311"],all:["xml-lang-mismatch"],any:[],none:[]},{id:"image-alt",selector:"img, [role='img']:not(svg)",tags:["cat.text-alternatives","wcag2a","wcag111","section508","section508.22.a"],all:[],any:["has-alt","aria-label","aria-labelledby","non-empty-title","role-presentation","role-none"],none:[]},{id:"image-redundant-alt",selector:'button, [role="button"], a[href], p, li, td, th',tags:["cat.text-alternatives","best-practice"],all:[],any:[],none:["duplicate-img-label"]},{id:"input-image-alt",selector:'input[type="image"]',tags:["cat.text-alternatives","wcag2a","wcag111","section508","section508.22.a"],all:[],any:["non-empty-alt","aria-label","aria-labelledby","non-empty-title"],none:[]},{id:"label-title-only",selector:"input, select, textarea",matches:function(e,t){if("input"!==e.nodeName.toLowerCase()||!1===e.hasAttribute("type"))return!0;var r=e.getAttribute("type").toLowerCase();return!1===["hidden","image","button","submit","reset"].includes(r)},tags:["cat.forms","best-practice"],all:[],any:[],none:["title-only"]},{id:"label",selector:"input, select, textarea",matches:function(e,t){if("input"!==e.nodeName.toLowerCase()||!1===e.hasAttribute("type"))return!0;var r=e.getAttribute("type").toLowerCase();return!1===["hidden","image","button","submit","reset"].includes(r)},tags:["cat.forms","wcag2a","wcag332","wcag131","section508","section508.22.n"],all:[],any:["aria-label","aria-labelledby","implicit-label","explicit-label","non-empty-title"],none:["help-same-as-label","multiple-label","hidden-explicit-label"]},{id:"landmark-banner-is-top-level",selector:"header:not([role]), [role=banner]",matches:function(e,t){return e.hasAttribute("role")||!axe.commons.dom.findUpVirtual(t,"article, aside, main, nav, section")},tags:["cat.semantics","best-practice"],all:[],any:["landmark-is-top-level"],none:[]},{id:"landmark-contentinfo-is-top-level",selector:"footer:not([role]), [role=contentinfo]",matches:function(e,t){return e.hasAttribute("role")||!axe.commons.dom.findUpVirtual(t,"article, aside, main, nav, section")},tags:["cat.semantics","best-practice"],all:[],any:["landmark-is-top-level"],none:[]},{id:"landmark-main-is-top-level",selector:"main:not([role]), [role=main]",tags:["cat.semantics","best-practice"],all:[],any:["landmark-is-top-level"],none:[]},{id:"landmark-no-duplicate-banner",selector:"html",tags:["cat.semantics","best-practice"],all:[],any:[{options:{selector:"header:not([role]), [role=banner]",nativeScopeFilter:"article, aside, main, nav, section"},id:"page-no-duplicate-banner"}],none:[]},{id:"landmark-no-duplicate-contentinfo",selector:"html",tags:["cat.semantics","best-practice"],all:[],any:[{options:{selector:"footer:not([role]), [role=contentinfo]",nativeScopeFilter:"article, aside, main, nav, section"},id:"page-no-duplicate-contentinfo"}],none:[]},{id:"landmark-one-main",selector:"html",tags:["cat.semantics","best-practice"],all:[{options:{selector:"main:not([role]), [role='main']"},id:"page-has-main"},{options:{selector:"main:not([role]), [role='main']"},id:"page-no-duplicate-main"}],any:[],none:[]},{id:"layout-table",selector:"table",matches:function(e,t){var r=(e.getAttribute("role")||"").toLowerCase();return!(("presentation"===r||"none"===r)&&!axe.commons.dom.isFocusable(e)||axe.commons.table.isDataTable(e))},tags:["cat.semantics","wcag2a","wcag131"],all:[],any:[],none:["has-th","has-caption","has-summary"]},{id:"link-in-text-block",selector:"a[href], [role=link]",matches:function(e,t){var r=axe.commons.text.sanitize(e.textContent),a=e.getAttribute("role");return(!a||"link"===a)&&(!!r&&(!!axe.commons.dom.isVisible(e,!1)&&axe.commons.dom.isInTextBlock(e)))},excludeHidden:!1,tags:["cat.color","experimental","wcag2a","wcag141"],all:["link-in-text-block"],any:[],none:[]},{id:"link-name",selector:"a[href], [role=link][href]",matches:function(e,t){return"button"!==e.getAttribute("role")},tags:["cat.name-role-value","wcag2a","wcag412","wcag244","section508","section508.22.a"],all:[],any:["has-visible-text","aria-label","aria-labelledby","role-presentation","role-none"],none:["focusable-no-name"]},{id:"list",selector:"ul, ol",matches:function(e,t){return!e.getAttribute("role")},tags:["cat.structure","wcag2a","wcag131"],all:[],any:[],none:["only-listitems"]},{id:"listitem",selector:"li",matches:function(e,t){return!e.getAttribute("role")},tags:["cat.structure","wcag2a","wcag131"],all:[],any:["listitem"],none:[]},{id:"marquee",selector:"marquee",excludeHidden:!1,tags:["cat.parsing","wcag2a","wcag222"],all:[],any:[],none:["is-on-screen"]},{id:"meta-refresh",selector:'meta[http-equiv="refresh"]',excludeHidden:!1,tags:["cat.time","wcag2a","wcag2aaa","wcag221","wcag224","wcag325"],all:[],any:["meta-refresh"],none:[]},{id:"meta-viewport-large",selector:'meta[name="viewport"]',excludeHidden:!1,tags:["cat.sensory-and-visual-cues","best-practice"],all:[],any:[{options:{scaleMinimum:5,lowerBound:2},id:"meta-viewport-large"}],none:[]},{id:"meta-viewport",selector:'meta[name="viewport"]',excludeHidden:!1,tags:["cat.sensory-and-visual-cues","wcag2aa","wcag144"],all:[],any:[{options:{scaleMinimum:2},id:"meta-viewport"}],none:[]},{id:"object-alt",selector:"object",tags:["cat.text-alternatives","wcag2a","wcag111","section508","section508.22.a"],all:[],any:["has-visible-text","aria-label","aria-labelledby","non-empty-title"],none:[]},{id:"p-as-heading",selector:"p",matches:function(e,t){var r=Array.from(e.parentNode.childNodes),a=e.textContent.trim();return!(0===a.length||2<=(a.match(/[.!?:;](?![.!?:;])/g)||[]).length)&&0!==r.slice(r.indexOf(e)+1).filter(function(e){return"P"===e.nodeName.toUpperCase()&&""!==e.textContent.trim()}).length},tags:["cat.semantics","wcag2a","wcag131","experimental"],all:[{options:{margins:[{weight:150,italic:!0},{weight:150,size:1.15},{italic:!0,size:1.15},{size:1.4}]},id:"p-as-heading"}],any:[],none:[]},{id:"page-has-heading-one",selector:"html",tags:["cat.semantics","best-practice"],all:[{options:{selector:'h1:not([role]), [role="heading"][aria-level="1"]'},id:"page-has-heading-one"}],any:[],none:[]},{id:"radiogroup",selector:"input[type=radio][name]",tags:["cat.forms","best-practice"],all:[],any:["group-labelledby","fieldset"],none:[]},{id:"region",selector:"html",pageLevel:!0,tags:["cat.keyboard","best-practice"],all:[],any:["region"],none:[]},{id:"scope-attr-valid",selector:"td[scope], th[scope]",tags:["cat.tables","best-practice"],all:["html5-scope","scope-value"],any:[],none:[]},{id:"server-side-image-map",selector:"img[ismap]",tags:["cat.text-alternatives","wcag2a","wcag211","section508","section508.22.f"],all:[],any:[],none:["exists"]},{id:"skip-link",selector:"a[href]",matches:function(e,t){return/^#[^/!]/.test(e.getAttribute("href"))},tags:["cat.keyboard","best-practice"],all:[],any:["skip-link"],none:[]},{id:"tabindex",selector:"[tabindex]",tags:["cat.keyboard","best-practice"],all:[],any:["tabindex"],none:[]},{id:"table-duplicate-name",selector:"table",tags:["cat.tables","best-practice"],all:[],any:[],none:["same-caption-summary"]},{id:"table-fake-caption",selector:"table",matches:function(e,t){return axe.commons.table.isDataTable(e)},tags:["cat.tables","experimental","wcag2a","wcag131","section508","section508.22.g"],all:["caption-faked"],any:[],none:[]},{id:"td-has-header",selector:"table",matches:function(e,t){if(axe.commons.table.isDataTable(e)){var r=axe.commons.table.toArray(e);return 3<=r.length&&3<=r[0].length&&3<=r[1].length&&3<=r[2].length}return!1},tags:["cat.tables","experimental","wcag2a","wcag131","section508","section508.22.g"],all:["td-has-header"],any:[],none:[]},{id:"td-headers-attr",selector:"table",tags:["cat.tables","wcag2a","wcag131","section508","section508.22.g"],all:["td-headers-attr"],any:[],none:[]},{id:"th-has-data-cells",selector:"table",matches:function(e,t){return axe.commons.table.isDataTable(e)},tags:["cat.tables","wcag2a","wcag131","section508","section508.22.g"],all:["th-has-data-cells"],any:[],none:[]},{id:"valid-lang",selector:"[lang], [xml\\:lang]",matches:function(e,t){return"html"!==e.nodeName.toLowerCase()},tags:["cat.language","wcag2aa","wcag312"],all:[],any:[],none:["valid-lang"]},{id:"video-caption",selector:"video",excludeHidden:!1,tags:["cat.text-alternatives","wcag2a","wcag122","section508","section508.22.a"],all:[],any:[],none:["caption"]},{id:"video-description",selector:"video",excludeHidden:!1,tags:["cat.text-alternatives","wcag2aa","wcag125","section508","section508.22.b"],all:[],any:[],none:["description"]}],checks:[{id:"abstractrole",evaluate:function(e,t,r,a){return"abstract"===axe.commons.aria.getRoleType(e.getAttribute("role"))}},{id:"aria-allowed-attr",evaluate:function(e,t,r,a){t=t||{};var n,o,i,s=[],l=e.getAttribute("role"),u=e.attributes;if(l||(l=axe.commons.aria.implicitRole(e)),i=axe.commons.aria.allowedAttr(l),Array.isArray(t[l])&&(i=axe.utils.uniqueArray(t[l].concat(i))),l&&i)for(var c=0,d=u.length;c<d;c++)o=(n=u[c]).name,axe.commons.aria.validateAttr(o)&&!i.includes(o)&&s.push(o+'="'+n.nodeValue+'"');return!s.length||(this.data(s),!1)}},{id:"aria-allowed-role",evaluate:function(e,t,r,a){var n=t||{},o=n.allowImplicit,i=void 0===o||o,s=n.ignoredTags,l=void 0===s?[]:s,u=e.nodeName.toUpperCase();if(l.map(function(e){return e.toUpperCase()}).includes(u))return!0;var c=axe.commons.aria.getElementUnallowedRoles(e,i);return!c.length||(this.data(c),!1)},options:{allowImplicit:!0,ignoredTags:[]}},{id:"aria-hidden-body",evaluate:function(e,t,r,a){return"true"!==e.getAttribute("aria-hidden")}},{id:"aria-errormessage",evaluate:function(t,e,r,a){e=Array.isArray(e)?e:[];var n=t.getAttribute("aria-errormessage"),o=t.hasAttribute("aria-errormessage"),i=axe.commons.dom.getRootNode(t);return!(-1===e.indexOf(n)&&o&&!function(){var e=n&&i.getElementById(n);if(e)return"alert"===e.getAttribute("role")||"assertive"===e.getAttribute("aria-live")||-1<axe.utils.tokenList(t.getAttribute("aria-describedby")||"").indexOf(n)}())||(this.data(axe.utils.tokenList(n)),!1)}},{id:"has-widget-role",evaluate:function(e,t,r,a){var n=e.getAttribute("role");if(null===n)return!1;var o=axe.commons.aria.getRoleType(n);return"widget"===o||"composite"===o},options:[]},{id:"implicit-role-fallback",evaluate:function(e,t,r,a){var n=e.getAttribute("role");if(null===n||!axe.commons.aria.isValidRole(n))return!0;var o=axe.commons.aria.getRoleType(n);return axe.commons.aria.implicitRole(e)===o}},{id:"invalidrole",evaluate:function(e,t,r,a){return!axe.commons.aria.isValidRole(e.getAttribute("role"),{allowAbstract:!0})}},{id:"aria-required-attr",evaluate:function(e,t,r,a){t=t||{};var n=[];if(e.hasAttributes()){var o,i=e.getAttribute("role"),s=axe.commons.aria.requiredAttr(i);if(Array.isArray(t[i])&&(s=axe.utils.uniqueArray(t[i],s)),i&&s)for(var l=0,u=s.length;l<u;l++)o=s[l],e.getAttribute(o)||n.push(o)}return!n.length||(this.data(n),!1)}},{id:"aria-required-children",evaluate:function(e,t,m,r){var a=axe.commons.aria.requiredOwned,i=axe.commons.aria.implicitNodes,s=axe.commons.utils.matchesSelector,p=axe.commons.dom.idrefs,n=t&&Array.isArray(t.reviewEmpty)?t.reviewEmpty:[];function f(e,t,r,a){if(null===e)return!1;var n=i(r),o=['[role="'+r+'"]'];return n&&(o=o.concat(n)),o=o.join(","),a&&s(e,o)||!!axe.utils.querySelectorAll(t,o)[0]}function h(e,t){var r,a;for(r=0,a=e.length;r<a;r++)if(null!==e[r]){var n=axe.utils.getNodeFromTree(axe._tree[0],e[r]);if(f(e[r],n,t,!0))return!0}return!1}var o=e.getAttribute("role"),l=a(o);if(!l)return!0;var u=!1,c=l.one;if(!c){u=!0;c=l.all}var d=function(e,t,r,a){var n,o=t.length,i=[],s=p(e,"aria-owns");for(n=0;n<o;n++){var l=t[n];if(f(e,m,l)||h(s,l)){if(!r)return null}else r&&i.push(l)}if("combobox"===a){var u=i.indexOf("textbox");0<=u&&"INPUT"===e.tagName&&["text","search","email","url","tel"].includes(e.type)&&i.splice(u,1);var c=i.indexOf("listbox"),d=e.getAttribute("aria-expanded");0<=c&&(!d||"false"===d)&&i.splice(c,1)}return i.length?i:!r&&t.length?t:null}(e,c,u,o);return!d||(this.data(d),!!n.includes(o)&&void 0)},options:{reviewEmpty:["listbox"]}},{id:"aria-required-parent",evaluate:function(e,t,r,a){function s(e){return(axe.commons.aria.implicitNodes(e)||[]).concat('[role="'+e+'"]').join(",")}function n(e,t,r){var a,n,o=e.actualNode.getAttribute("role"),i=[];if(t||(t=axe.commons.aria.requiredContext(o)),!t)return null;for(a=0,n=t.length;a<n;a++){if(r&&axe.utils.matchesSelector(e.actualNode,s(t[a])))return null;if(axe.commons.dom.findUpVirtual(e,s(t[a])))return null;i.push(t[a])}return i}var o=n(r);if(!o)return!0;var i=function(e){for(var t=[],r=null;e;){if(e.getAttribute("id")){var a=axe.commons.utils.escapeSelector(e.getAttribute("id"));(r=axe.commons.dom.getRootNode(e).querySelector("[aria-owns~="+a+"]"))&&t.push(r)}e=e.parentElement}return t.length?t:null}(e);if(i)for(var l=0,u=i.length;l<u;l++)if(!(o=n(axe.utils.getNodeFromTree(axe._tree[0],i[l]),o,!0)))return!0;return this.data(o),!1}},{id:"unsupportedrole",evaluate:function(e,t,r,a){return!axe.commons.aria.isValidRole(e.getAttribute("role"),{flagUnsupported:!0})}},{id:"aria-valid-attr-value",evaluate:function(e,t,r,a){t=Array.isArray(t)?t:[];for(var n,o,i=[],s=/^aria-/,l=e.attributes,u=["aria-errormessage"],c=0,d=l.length;c<d;c++)o=(n=l[c]).name,u.includes(o)||-1===t.indexOf(o)&&s.test(o)&&!axe.commons.aria.validateAttrValue(e,o)&&i.push(o+'="'+n.nodeValue+'"');return!i.length||(this.data(i),!1)},options:[]},{id:"aria-valid-attr",evaluate:function(e,t,r,a){t=Array.isArray(t)?t:[];for(var n,o=[],i=/^aria-/,s=e.attributes,l=0,u=s.length;l<u;l++)n=s[l].name,-1===t.indexOf(n)&&i.test(n)&&!axe.commons.aria.validateAttr(n)&&o.push(n);return!o.length||(this.data(o),!1)},options:[]},{id:"valid-scrollable-semantics",evaluate:function(e,t,r,a){var n,o,i,s={ARTICLE:!0,ASIDE:!0,NAV:!0,SECTION:!0},l={application:!0,banner:!1,complementary:!0,contentinfo:!0,form:!0,main:!0,navigation:!0,region:!0,search:!1};return(i=(n=e).getAttribute("role"))&&l[i.toLowerCase()]||(o=n.tagName.toUpperCase(),s[o]||!1)},options:[]},{id:"color-contrast",evaluate:function(e,t,r,a){var n=axe.commons,o=n.dom,i=n.color,s=n.text;if(!o.isVisible(e,!1))return!0;var l=!!(t||{}).noScroll,u=[],c=i.getBackgroundColor(e,u,l),d=i.getForegroundColor(e,l),m=window.getComputedStyle(e),p=parseFloat(m.getPropertyValue("font-size")),f=m.getPropertyValue("font-weight"),h=-1!==["bold","bolder","600","700","800","900"].indexOf(f),g=i.hasValidContrastRatio(c,d,p,h),b=Math.floor(100*g.contrastRatio)/100,y=void 0;null===c&&(y=i.incompleteData.get("bgColor"));var v=1===b,w=1===s.visibleVirtual(r,!1,!0).length;v?y=i.incompleteData.set("bgColor","equalRatio"):w&&(y="shortTextContent");var k={fgColor:d?d.toHexString():void 0,bgColor:c?c.toHexString():void 0,contrastRatio:g?b:void 0,fontSize:(72*p/96).toFixed(1)+"pt",fontWeight:h?"bold":"normal",missingData:y,expectedContrastRatio:g.expectedContrastRatio+":1"};return this.data(k),null===d||null===c||v||w&&!g.isValid?(y=null,i.incompleteData.clear(),void this.relatedNodes(u)):(g.isValid||this.relatedNodes(u),g.isValid)}},{id:"link-in-text-block",evaluate:function(e,t,r,a){var n=axe.commons,o=n.color,i=n.dom;function s(e,t){var r=e.getRelativeLuminance(),a=t.getRelativeLuminance();return(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}var l=["block","list-item","table","flex","grid","inline-block"];function u(e){var t=window.getComputedStyle(e).getPropertyValue("display");return-1!==l.indexOf(t)||"table-"===t.substr(0,6)}if(u(e))return!1;for(var c,d,m=i.getComposedParent(e);1===m.nodeType&&!u(m);)m=i.getComposedParent(m);if(this.relatedNodes([m]),o.elementIsDistinct(e,m))return!0;if(c=o.getForegroundColor(e),d=o.getForegroundColor(m),c&&d){var p=s(c,d);if(1===p)return!0;if(3<=p)return axe.commons.color.incompleteData.set("fgColor","bgContrast"),this.data({missingData:axe.commons.color.incompleteData.get("fgColor")}),void axe.commons.color.incompleteData.clear();if(c=o.getBackgroundColor(e),d=o.getBackgroundColor(m),!c||!d||3<=s(c,d)){var f=void 0;return f=c&&d?"bgContrast":axe.commons.color.incompleteData.get("bgColor"),axe.commons.color.incompleteData.set("fgColor",f),this.data({missingData:axe.commons.color.incompleteData.get("fgColor")}),void axe.commons.color.incompleteData.clear()}return!1}}},{id:"autocomplete-appropriate",evaluate:function(e,t,r,a){if("INPUT"!==e.nodeName.toUpperCase())return!0;var n=["text","search","number"],o=["text","search","url"],i={bday:["text","search","date"],email:["text","search","email"],"cc-exp":["text","search","month"],"street-address":[],tel:["text","search","tel"],"cc-exp-month":n,"cc-exp-year":n,"transaction-amount":n,"bday-day":n,"bday-month":n,"bday-year":n,"new-password":["text","search","password"],"current-password":["text","search","password"],url:o,photo:o,impp:o};"object"===(void 0===t?"undefined":T(t))&&Object.keys(t).forEach(function(e){i[e]||(i[e]=[]),i[e]=i[e].concat(t[e])});var s=e.getAttribute("autocomplete").split(/\s+/g).map(function(e){return e.toLowerCase()}),l=s[s.length-1],u=i[l];return void 0===u?"text"===e.type:u.includes(e.type)}},{id:"autocomplete-valid",evaluate:function(e,t,r,a){var n=e.getAttribute("autocomplete")||"";return axe.commons.text.isValidAutocomplete(n,t)}},{id:"fieldset",evaluate:function(e,t,r,a){var s,l=this;function u(e,t){return axe.commons.utils.toArray(e.querySelectorAll('select,textarea,button,input:not([name="'+t+'"]):not([type="hidden"])'))}var n={name:e.getAttribute("name"),type:e.getAttribute("type")},o=function(e){var t=axe.commons.utils.escapeSelector(e.actualNode.name),r=axe.commons.dom.getRootNode(e.actualNode).querySelectorAll('input[type="'+axe.commons.utils.escapeSelector(e.actualNode.type)+'"][name="'+t+'"]');if(r.length<2)return!0;var a,n,o=axe.commons.dom.findUpVirtual(e,"fieldset"),i=axe.commons.dom.findUpVirtual(e,'[role="group"]'+("radio"===e.actualNode.type?',[role="radiogroup"]':""));return i||o?o?function(e,t){var r=e.firstElementChild;if(!r||"LEGEND"!==r.nodeName.toUpperCase())return l.relatedNodes([e]),!(s="no-legend");if(!axe.commons.text.accessibleText(r))return l.relatedNodes([r]),!(s="empty-legend");var a=u(e,t);return!(a.length&&(l.relatedNodes(a),s="mixed-inputs"))}(o,t):function(e,t){var r=axe.commons.dom.idrefs(e,"aria-labelledby").some(function(e){return e&&axe.commons.text.accessibleText(e)}),a=e.getAttribute("aria-label");if(!(r||a&&axe.commons.text.sanitize(a)))return l.relatedNodes(e),!(s="no-group-label");var n=u(e,t);return!(n.length&&(l.relatedNodes(n),s="group-mixed-inputs"))}(i,t):(s="no-group",l.relatedNodes((a=r,n=e.actualNode,axe.commons.utils.toArray(a).filter(function(e){return e!==n}))),!1)}(r);return o||(n.failureCode=s),this.data(n),o},after:function(e,t){var a={};return e.filter(function(e){if(e.result)return!0;var t=e.data;if(t){if(a[t.type]=a[t.type]||{},!a[t.type][t.name])return a[t.type][t.name]=[t],!0;var r=a[t.type][t.name].some(function(e){return e.failureCode===t.failureCode});return r||a[t.type][t.name].push(t),!r}return!1})}},{id:"group-labelledby",evaluate:function(e,t,r,a){this.data({name:e.getAttribute("name"),type:e.getAttribute("type")});var n=axe.commons.dom.getRootNode(e),o=n.querySelectorAll('input[type="'+axe.commons.utils.escapeSelector(e.type)+'"][name="'+axe.commons.utils.escapeSelector(e.name)+'"]');return o.length<=1||0!==[].map.call(o,function(e){var t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/):[]}).reduce(function(e,t){return e.filter(function(e){return t.includes(e)})}).filter(function(e){var t=n.getElementById(e);return t&&axe.commons.text.accessibleText(t,!0)}).length},after:function(e,t){var r={};return e.filter(function(e){var t=e.data;return!(!t||(r[t.type]=r[t.type]||{},r[t.type][t.name]))&&(r[t.type][t.name]=!0)})}},{id:"accesskeys",evaluate:function(e,t,r,a){return axe.commons.dom.isVisible(e,!1)&&(this.data(e.getAttribute("accesskey")),this.relatedNodes([e])),!0},after:function(e,t){var r={};return e.filter(function(e){if(!e.data)return!1;var t=e.data.toUpperCase();return r[t]?(r[t].relatedNodes.push(e.relatedNodes[0]),!1):((r[t]=e).relatedNodes=[],!0)}).map(function(e){return e.result=!!e.relatedNodes.length,e})}},{id:"focusable-no-name",evaluate:function(e,t,r,a){var n=e.getAttribute("tabindex");return!!(axe.commons.dom.isFocusable(e)&&-1<n)&&!axe.commons.text.accessibleTextVirtual(r)}},{id:"landmark-is-top-level",evaluate:function(e,t,r,a){var n=axe.commons.aria.getRolesByType("landmark"),o=axe.commons.dom.getComposedParent(e);for(this.data({role:e.getAttribute("role")||axe.commons.aria.implicitRole(e)});o;){var i=o.getAttribute("role");if(i||"form"===o.tagName.toLowerCase()||(i=axe.commons.aria.implicitRole(o)),i&&n.includes(i))return!1;o=axe.commons.dom.getComposedParent(o)}return!0}},{id:"page-has-heading-one",evaluate:function(e,t,r,a){if(!t||!t.selector||"string"!=typeof t.selector)throw new TypeError("visible-in-page requires options.selector to be a string");var n=axe.utils.querySelectorAll(r,t.selector);return this.relatedNodes(n.map(function(e){return e.actualNode})),0<n.length},after:function(e,t){return e.some(function(e){return!0===e.result})&&e.forEach(function(e){e.result=!0}),e},options:{selector:'h1:not([role]), [role="heading"][aria-level="1"]'}},{id:"page-has-main",evaluate:function(e,t,r,a){if(!t||!t.selector||"string"!=typeof t.selector)throw new TypeError("visible-in-page requires options.selector to be a string");var n=axe.utils.querySelectorAll(r,t.selector);return this.relatedNodes(n.map(function(e){return e.actualNode})),0<n.length},after:function(e,t){return e.some(function(e){return!0===e.result})&&e.forEach(function(e){e.result=!0}),e},options:{selector:"main:not([role]), [role='main']"}},{id:"page-no-duplicate-banner",evaluate:function(e,t,r,a){if(!t||!t.selector||"string"!=typeof t.selector)throw new TypeError("visible-in-page requires options.selector to be a string");var n=axe.utils.querySelectorAll(r,t.selector);return"string"==typeof t.nativeScopeFilter&&(n=n.filter(function(e){return e.actualNode.hasAttribute("role")||!axe.commons.dom.findUpVirtual(e,t.nativeScopeFilter)})),this.relatedNodes(n.map(function(e){return e.actualNode})),n.length<=1},options:{selector:"header:not([role]), [role=banner]",nativeScopeFilter:"article, aside, main, nav, section"}},{id:"page-no-duplicate-contentinfo",evaluate:function(e,t,r,a){if(!t||!t.selector||"string"!=typeof t.selector)throw new TypeError("visible-in-page requires options.selector to be a string");var n=axe.utils.querySelectorAll(r,t.selector);return"string"==typeof t.nativeScopeFilter&&(n=n.filter(function(e){return e.actualNode.hasAttribute("role")||!axe.commons.dom.findUpVirtual(e,t.nativeScopeFilter)})),this.relatedNodes(n.map(function(e){return e.actualNode})),n.length<=1},options:{selector:"footer:not([role]), [role=contentinfo]",nativeScopeFilter:"article, aside, main, nav, section"}},{id:"page-no-duplicate-main",evaluate:function(e,t,r,a){if(!t||!t.selector||"string"!=typeof t.selector)throw new TypeError("visible-in-page requires options.selector to be a string");var n=axe.utils.querySelectorAll(r,t.selector);return"string"==typeof t.nativeScopeFilter&&(n=n.filter(function(e){return e.actualNode.hasAttribute("role")||!axe.commons.dom.findUpVirtual(e,t.nativeScopeFilter)})),this.relatedNodes(n.map(function(e){return e.actualNode})),n.length<=1},options:{selector:"main:not([role]), [role='main']"}},{id:"tabindex",evaluate:function(e,t,r,a){return e.tabIndex<=0}},{id:"duplicate-img-label",evaluate:function(e,t,r,a){var n=axe.commons.text.visibleVirtual(r,!0).toLowerCase();return""!==n&&axe.utils.querySelectorAll(r,"img").filter(function(e){var t=e.actualNode;return axe.commons.dom.isVisible(t)&&!["none","presentation"].includes(t.getAttribute("role"))}).some(function(e){return n===axe.commons.text.accessibleTextVirtual(e).toLowerCase()})}},{id:"explicit-label",evaluate:function(e,t,r,a){if(e.getAttribute("id")){var n=axe.commons.dom.getRootNode(e),o=axe.commons.utils.escapeSelector(e.getAttribute("id")),i=n.querySelector('label[for="'+o+'"]');if(i)return!axe.commons.dom.isVisible(i)||!!axe.commons.text.accessibleText(i)}return!1}},{id:"help-same-as-label",evaluate:function(e,t,r,a){var n=axe.commons.text.labelVirtual(r),o=e.getAttribute("title");if(!n)return!1;o||(o="",e.getAttribute("aria-describedby")&&(o=axe.commons.dom.idrefs(e,"aria-describedby").map(function(e){return e?axe.commons.text.accessibleText(e):""}).join("")));return axe.commons.text.sanitize(o)===axe.commons.text.sanitize(n)},enabled:!1},{id:"hidden-explicit-label",evaluate:function(e,t,r,a){if(e.getAttribute("id")){var n=axe.commons.dom.getRootNode(e),o=axe.commons.utils.escapeSelector(e.getAttribute("id")),i=n.querySelector('label[for="'+o+'"]');if(i&&!axe.commons.dom.isVisible(i))return!0}return!1}},{id:"implicit-label",evaluate:function(e,t,r,a){var n=axe.commons.dom.findUpVirtual(r,"label");return!!n&&!!axe.commons.text.accessibleTextVirtual(n)}},{id:"multiple-label",evaluate:function(e,t,r,a){var n=axe.commons.utils.escapeSelector(e.getAttribute("id")),o=Array.from(document.querySelectorAll('label[for="'+n+'"]')),i=e.parentNode;for(o.length&&(o=o.filter(function(e,t){if(0===t&&!axe.commons.dom.isVisible(e,!0)||axe.commons.dom.isVisible(e,!0))return e}));i;)"LABEL"===i.tagName&&-1===o.indexOf(i)&&o.push(i),i=i.parentNode;return this.relatedNodes(o),1<o.length}},{id:"title-only",evaluate:function(e,t,r,a){return!(axe.commons.text.labelVirtual(r)||!e.getAttribute("title")&&!e.getAttribute("aria-describedby"))}},{id:"has-lang",evaluate:function(e,t,r,a){return!!(e.getAttribute("lang")||e.getAttribute("xml:lang")||"").trim()}},{id:"valid-lang",evaluate:function(n,e,t,r){var o,a;return o=(e||axe.commons.utils.validLangs()).map(axe.commons.utils.getBaseLang),!!(a=["lang","xml:lang"].reduce(function(e,t){var r=n.getAttribute(t);if("string"!=typeof r)return e;var a=axe.commons.utils.getBaseLang(r);return""!==a&&-1===o.indexOf(a)&&e.push(t+'="'+n.getAttribute(t)+'"'),e},[])).length&&(this.data(a),!0)}},{id:"xml-lang-mismatch",evaluate:function(e,t,r,a){var n=axe.commons.utils.getBaseLang;return n(e.getAttribute("lang"))===n(e.getAttribute("xml:lang"))}},{id:"dlitem",evaluate:function(e,t,r,a){var n=axe.commons.dom.getComposedParent(e);if("DL"!==n.nodeName.toUpperCase())return!1;var o=(n.getAttribute("role")||"").toLowerCase();return!o||!axe.commons.aria.isValidRole(o)||"list"===o}},{id:"has-listitem",evaluate:function(e,t,r,a){return r.children.every(function(e){return"LI"!==e.actualNode.nodeName.toUpperCase()})}},{id:"listitem",evaluate:function(e,t,r,a){var n=axe.commons.dom.getComposedParent(e);if(n){var o=n.nodeName.toUpperCase(),i=(n.getAttribute("role")||"").toLowerCase();return"list"===i||(!i||!axe.commons.aria.isValidRole(i))&&["UL","OL"].includes(o)}}},{id:"only-dlitems",evaluate:function(e,t,r,a){var n=axe.commons,o=n.dom,i=n.aria,s=["definition","term","list"],l=r.children.reduce(function(e,t){var r=t.actualNode;return"DIV"===r.nodeName.toUpperCase()&&null===i.getRole(r)?e.concat(t.children):e.concat(t)},[]).reduce(function(e,t){var r=t.actualNode,a=r.nodeName.toUpperCase();if(1===r.nodeType&&o.isVisible(r,!0,!1)){var n=i.getRole(r,{noImplicit:!0});("DT"!==a&&"DD"!==a||n)&&(s.includes(n)||e.badNodes.push(r))}else 3===r.nodeType&&""!==r.nodeValue.trim()&&(e.hasNonEmptyTextNode=!0);return e},{badNodes:[],hasNonEmptyTextNode:!1});return l.badNodes.length&&this.relatedNodes(l.badNodes),!!l.badNodes.length||l.hasNonEmptyTextNode}},{id:"only-listitems",evaluate:function(e,t,r,a){var d=axe.commons.dom,n=r.children.reduce(function(e,t){var r,a,n,o,i,s=t.actualNode,l=s.nodeName.toUpperCase();if(1===s.nodeType&&d.isVisible(s,!0,!1)){var u=(s.getAttribute("role")||"").toLowerCase(),c=(i=l,"listitem"===(o=u)||"LI"===i&&!o);e.hasListItem=(r=e.hasListItem,a=l,n=c,r||"LI"===a&&n||n),c&&(e.isEmpty=!1),"LI"!==l||c||e.liItemsWithRole++,"LI"===l||c||e.badNodes.push(s)}return 3===s.nodeType&&""!==s.nodeValue.trim()&&(e.hasNonEmptyTextNode=!0),e},{badNodes:[],isEmpty:!0,hasNonEmptyTextNode:!1,hasListItem:!1,liItemsWithRole:0}),o=r.children.filter(function(e){return"LI"===e.actualNode.nodeName.toUpperCase()}),i=0<n.liItemsWithRole&&o.length===n.liItemsWithRole;return n.badNodes.length&&this.relatedNodes(n.badNodes),!(n.hasListItem||n.isEmpty&&!i)||!!n.badNodes.length||n.hasNonEmptyTextNode}},{id:"structured-dlitems",evaluate:function(e,t,r,a){var n=r.children;if(!n||!n.length)return!1;for(var o,i=!1,s=!1,l=0;l<n.length;l++){if("DT"===(o=n[l].actualNode.nodeName.toUpperCase())&&(i=!0),i&&"DD"===o)return!1;"DD"===o&&(s=!0)}return i||s}},{id:"caption",evaluate:function(e,t,r,a){return!axe.utils.querySelectorAll(r,"track").some(function(e){return"captions"===(e.actualNode.getAttribute("kind")||"").toLowerCase()})&&void 0}},{id:"description",evaluate:function(e,t,r,a){return!axe.utils.querySelectorAll(r,"track").some(function(e){return"descriptions"===(e.actualNode.getAttribute("kind")||"").toLowerCase()})&&void 0}},{id:"frame-tested",evaluate:function(e,t,r,a){var n=this.async(),o=Object.assign({isViolation:!1,timeout:500},t),i=o.isViolation,s=o.timeout,l=setTimeout(function(){l=setTimeout(function(){l=null,n(!i&&void 0)},0)},s);axe.utils.respondable(e.contentWindow,"axe.ping",null,void 0,function(){null!==l&&(clearTimeout(l),n(!0))})},options:{isViolation:!1}},{id:"css-orientation-lock",evaluate:function(e,t,r,a){var n=(a||{}).cssom,o=void 0===n?void 0:n;if(o&&o.length){var i=o.reduce(function(e,t){var r=t.sheet,a=t.root,n=t.shadowId,o=n||"topDocument";if(e[o]||(e[o]={root:a,rules:[]}),!r||!r.cssRules)return e;var i=Array.from(r.cssRules);return e[o].rules=e[o].rules.concat(i),e},{}),l=!1,u=[];return Object.keys(i).forEach(function(e){var t=i[e],s=t.root,r=t.rules.filter(function(e){return 4===e.type});if(r&&r.length){var a=r.filter(function(e){var t=e.cssText;return/orientation:\s+landscape/i.test(t)||/orientation:\s+portrait/i.test(t)});a&&a.length&&a.forEach(function(e){e.cssRules.length&&Array.from(e.cssRules).forEach(function(e){if(e.selectorText&&!(e.style.length<=0)){var t=e.style.transform||!1;if(t){var r=t.match(/rotate\(([^)]+)deg\)/),a=parseInt(r&&r[1]||0),n=a%90==0&&a%180!=0;if(n&&"HTML"!==e.selectorText.toUpperCase()){var o=e.selectorText,i=Array.from(s.querySelectorAll(o));i&&i.length&&(u=u.concat(i))}l=n}}})})}}),l?(u.length&&this.relatedNodes(u),!1):!0}}},{id:"meta-viewport-large",evaluate:function(e,t,r,a){t=t||{};for(var n,o=(e.getAttribute("content")||"").split(/[;,]/),i={},s=t.scaleMinimum||2,l=t.lowerBound||!1,u=0,c=o.length;u<c;u++){var d=(n=o[u].split("=")).shift().toLowerCase();d&&n.length&&(i[d.trim()]=n.shift().trim().toLowerCase())}return!!(l&&i["maximum-scale"]&&parseFloat(i["maximum-scale"])<l)||(l||"no"!==i["user-scalable"]?!(i["maximum-scale"]&&parseFloat(i["maximum-scale"])<s)||(this.data("maximum-scale"),!1):(this.data("user-scalable=no"),!1))},options:{scaleMinimum:5,lowerBound:2}},{id:"meta-viewport",evaluate:function(e,t,r,a){t=t||{};for(var n,o=(e.getAttribute("content")||"").split(/[;,]/),i={},s=t.scaleMinimum||2,l=t.lowerBound||!1,u=0,c=o.length;u<c;u++){var d=(n=o[u].split("=")).shift().toLowerCase();d&&n.length&&(i[d.trim()]=n.shift().trim().toLowerCase())}return!!(l&&i["maximum-scale"]&&parseFloat(i["maximum-scale"])<l)||(l||"no"!==i["user-scalable"]?!(i["maximum-scale"]&&parseFloat(i["maximum-scale"])<s)||(this.data("maximum-scale"),!1):(this.data("user-scalable=no"),!1))},options:{scaleMinimum:2}},{id:"header-present",evaluate:function(e,t,r,a){return!!axe.utils.querySelectorAll(r,'h1, h2, h3, h4, h5, h6, [role="heading"]')[0]}},{id:"heading-order",evaluate:function(e,t,r,a){var n=e.getAttribute("aria-level");if(null!==n)return this.data(parseInt(n,10)),!0;var o=e.tagName.match(/H(\d)/);return o&&this.data(parseInt(o[1],10)),!0},after:function(e,t){if(e.length<2)return e;for(var r=e[0].data,a=1;a<e.length;a++)e[a].result&&e[a].data>r+1&&(e[a].result=!1),r=e[a].data;return e}},{id:"internal-link-present",evaluate:function(e,t,r,a){return axe.utils.querySelectorAll(r,"a[href]").some(function(e){return/^#[^/!]/.test(e.actualNode.getAttribute("href"))})}},{id:"landmark",evaluate:function(e,t,r,a){return 0<axe.utils.querySelectorAll(r,'main, [role="main"]').length}},{id:"meta-refresh",evaluate:function(e,t,r,a){var n=e.getAttribute("content")||"",o=n.split(/[;,]/);return""===n||"0"===o[0]}},{id:"p-as-heading",evaluate:function(e,t,r,a){var n=Array.from(e.parentNode.children),o=n.indexOf(e),i=(t=t||{}).margins||[],s=n.slice(o+1).find(function(e){return"P"===e.nodeName.toUpperCase()}),l=n.slice(0,o).reverse().find(function(e){return"P"===e.nodeName.toUpperCase()});function u(e){var t=window.getComputedStyle(function(e){for(var t=e,r=e.textContent.trim(),a=r;a===r&&void 0!==t;){var n=-1;if(0===(e=t).children.length)return e;for(;n++,""===(a=e.children[n].textContent.trim())&&n+1<e.children.length;);t=e.children[n]}return e}(e));return{fontWeight:function(e){switch(e){case"lighter":return 100;case"normal":return 400;case"bold":return 700;case"bolder":return 900}return e=parseInt(e),isNaN(e)?400:e}(t.getPropertyValue("font-weight")),fontSize:parseInt(t.getPropertyValue("font-size")),isItalic:"italic"===t.getPropertyValue("font-style")}}function c(r,a,e){return e.reduce(function(e,t){return e||(!t.size||r.fontSize/t.size>a.fontSize)&&(!t.weight||r.fontWeight-t.weight>a.fontWeight)&&(!t.italic||r.isItalic&&!a.isItalic)},!1)}var d=u(e),m=s?u(s):null,p=l?u(l):null;if(!m||!c(d,m,i))return!0;var f=axe.commons.dom.findUpVirtual(r,"blockquote");return!!(f&&"BLOCKQUOTE"===f.nodeName.toUpperCase()||p&&!c(d,p,i))&&void 0},options:{margins:[{weight:150,italic:!0},{weight:150,size:1.15},{italic:!0,size:1.15},{size:1.4}]}},{id:"region",evaluate:function(e,t,r,a){var n=axe.commons,l=n.dom,u=n.aria;var c=function(e){var t=axe.utils.querySelectorAll(e,"a[href]")[0];if(t&&axe.commons.dom.getElementByReference(t.actualNode,"href"))return t.actualNode}(r),d=u.getRolesByType("landmark"),m=d.reduce(function(e,t){return e.concat(u.implicitNodes(t))},[]).filter(function(e){return null!==e});var o=function e(t){var r,n,o,a,i,s=t.actualNode;return o=(n=t).actualNode,a=axe.commons.aria.getRole(o,{noImplicit:!0}),i=(o.getAttribute("aria-live")||"").toLowerCase().trim(),(a?"dialog"===a||d.includes(a):["assertive","polite"].includes(i)||m.some(function(e){var t=axe.utils.matchesSelector(o,e);if("form"!==o.tagName.toLowerCase())return t;var r=o.getAttribute("title"),a=r&&""!==r.trim()?axe.commons.text.sanitize(r):null;return t&&(!!u.labelVirtual(n)||!!a)}))||(r=t,c&&c===r.actualNode)||!l.isVisible(s,!0)?[]:l.hasContent(s,!0)?[s]:t.children.filter(function(e){return 1===e.actualNode.nodeType}).map(e).reduce(function(e,t){return e.concat(t)},[])}(r);return this.relatedNodes(o),0===o.length},after:function(e,t){return[e[0]]}},{id:"skip-link",evaluate:function(e,t,r,a){var n=axe.commons.dom.getElementByReference(e,"href");return!!n&&(axe.commons.dom.isVisible(n,!0)||void 0)}},{id:"unique-frame-title",evaluate:function(e,t,r,a){var n=axe.commons.text.sanitize(e.title).trim().toLowerCase();return this.data(n),!0},after:function(e,t){var r={};return e.forEach(function(e){r[e.data]=void 0!==r[e.data]?++r[e.data]:0}),e.forEach(function(e){e.result=!!r[e.data]}),e}},{id:"duplicate-id-active",evaluate:function(t,e,r,a){var n=t.getAttribute("id").trim();if(!n)return!0;var o=axe.commons.dom.getRootNode(t),i=Array.from(o.querySelectorAll('[id="'+axe.commons.utils.escapeSelector(n)+'"]')).filter(function(e){return e!==t});return i.length&&this.relatedNodes(i),this.data(n),0===i.length},after:function(e,t){var r=[];return e.filter(function(e){return-1===r.indexOf(e.data)&&(r.push(e.data),!0)})}},{id:"duplicate-id-aria",evaluate:function(t,e,r,a){var n=t.getAttribute("id").trim();if(!n)return!0;var o=axe.commons.dom.getRootNode(t),i=Array.from(o.querySelectorAll('[id="'+axe.commons.utils.escapeSelector(n)+'"]')).filter(function(e){return e!==t});return i.length&&this.relatedNodes(i),this.data(n),0===i.length},after:function(e,t){var r=[];return e.filter(function(e){return-1===r.indexOf(e.data)&&(r.push(e.data),!0)})}},{id:"duplicate-id",evaluate:function(t,e,r,a){var n=t.getAttribute("id").trim();if(!n)return!0;var o=axe.commons.dom.getRootNode(t),i=Array.from(o.querySelectorAll('[id="'+axe.commons.utils.escapeSelector(n)+'"]')).filter(function(e){return e!==t});return i.length&&this.relatedNodes(i),this.data(n),0===i.length},after:function(e,t){var r=[];return e.filter(function(e){return-1===r.indexOf(e.data)&&(r.push(e.data),!0)})}},{id:"aria-label",evaluate:function(e,t,r,a){var n=e.getAttribute("aria-label");return!(!n||!axe.commons.text.sanitize(n).trim())}},{id:"aria-labelledby",evaluate:function(e,t,r,a){return(0,axe.commons.dom.idrefs)(e,"aria-labelledby").some(function(e){return e&&axe.commons.text.accessibleText(e,!0)})}},{id:"button-has-visible-text",evaluate:function(e,t,r,a){var n=e.nodeName.toUpperCase(),o=e.getAttribute("role"),i=void 0;return("BUTTON"===n||"button"===o&&"INPUT"!==n)&&(i=axe.commons.text.accessibleTextVirtual(r),this.data(i),!!i)}},{id:"doc-has-title",evaluate:function(e,t,r,a){var n=document.title;return!(!n||!axe.commons.text.sanitize(n).trim())}},{id:"exists",evaluate:function(e,t,r,a){return!0}},{id:"has-alt",evaluate:function(e,t,r,a){var n=e.nodeName.toLowerCase();return e.hasAttribute("alt")&&("img"===n||"input"===n||"area"===n)}},{id:"has-visible-text",evaluate:function(e,t,r,a){return 0<axe.commons.text.accessibleTextVirtual(r).length}},{id:"is-on-screen",evaluate:function(e,t,r,a){return axe.commons.dom.isVisible(e,!1)&&!axe.commons.dom.isOffscreen(e)}},{id:"non-empty-alt",evaluate:function(e,t,r,a){var n=e.getAttribute("alt");return!(!n||!axe.commons.text.sanitize(n).trim())}},{id:"non-empty-if-present",evaluate:function(e,t,r,a){var n=e.nodeName.toUpperCase(),o=(e.getAttribute("type")||"").toLowerCase(),i=e.getAttribute("value");return this.data(i),!("INPUT"!==n||!["submit","reset"].includes(o))&&null===i}},{id:"non-empty-title",evaluate:function(e,t,r,a){var n=e.getAttribute("title");return!(!n||!axe.commons.text.sanitize(n).trim())}},{id:"non-empty-value",evaluate:function(e,t,r,a){var n=e.getAttribute("value");return!(!n||!axe.commons.text.sanitize(n).trim())}},{id:"role-none",evaluate:function(e,t,r,a){return"none"===e.getAttribute("role")}},{id:"role-presentation",evaluate:function(e,t,r,a){return"presentation"===e.getAttribute("role")}},{id:"caption-faked",evaluate:function(e,t,r,a){var n=axe.commons.table.toGrid(e),o=n[0];return n.length<=1||o.length<=1||e.rows.length<=1||o.reduce(function(e,t,r){return e||t!==o[r+1]&&void 0!==o[r+1]},!1)}},{id:"has-caption",evaluate:function(e,t,r,a){return!!e.caption}},{id:"has-summary",evaluate:function(e,t,r,a){return!!e.summary}},{id:"has-th",evaluate:function(e,t,r,a){for(var n,o,i=[],s=0,l=e.rows.length;s<l;s++)for(var u=0,c=(n=e.rows[s]).cells.length;u<c;u++)"TH"!==(o=n.cells[u]).nodeName.toUpperCase()&&-1===["rowheader","columnheader"].indexOf(o.getAttribute("role"))||i.push(o);return!!i.length&&(this.relatedNodes(i),!0)}},{id:"html5-scope",evaluate:function(e,t,r,a){return!axe.commons.dom.isHTML5(document)||"TH"===e.nodeName.toUpperCase()}},{id:"same-caption-summary",evaluate:function(e,t,r,a){return!(!e.summary||!e.caption)&&e.summary.toLowerCase()===axe.commons.text.accessibleText(e.caption).toLowerCase()}},{id:"scope-value",evaluate:function(e,t,r,a){t=t||{};var n=e.getAttribute("scope").toLowerCase();return-1!==["row","col","rowgroup","colgroup"].indexOf(n)}},{id:"td-has-header",evaluate:function(e,t,r,a){var n=axe.commons.table,o=[];return n.getAllCells(e).forEach(function(e){axe.commons.dom.hasContent(e)&&n.isDataCell(e)&&!axe.commons.aria.label(e)&&(n.getHeaders(e).some(function(e){return null!==e&&!!axe.commons.dom.hasContent(e)})||o.push(e))}),!o.length||(this.relatedNodes(o),!1)}},{id:"td-headers-attr",evaluate:function(e,t,r,a){for(var n=[],o=0,i=e.rows.length;o<i;o++)for(var s=e.rows[o],l=0,u=s.cells.length;l<u;l++)n.push(s.cells[l]);var c=n.reduce(function(e,t){return t.getAttribute("id")&&e.push(t.getAttribute("id")),e},[]),d=n.reduce(function(e,t){var r,a,n=(t.getAttribute("headers")||"").split(/\s/).reduce(function(e,t){return(t=t.trim())&&e.push(t),e},[]);return 0!==n.length&&(t.getAttribute("id")&&(r=-1!==n.indexOf(t.getAttribute("id").trim())),a=n.reduce(function(e,t){return e||-1===c.indexOf(t)},!1),(r||a)&&e.push(t)),e},[]);return!(0<d.length)||(this.relatedNodes(d),!1)}},{id:"th-has-data-cells",evaluate:function(e,t,r,a){var n=axe.commons.table,o=n.getAllCells(e),i=this,s=[];o.forEach(function(e){var t=e.getAttribute("headers");t&&(s=s.concat(t.split(/\s+/)));var r=e.getAttribute("aria-labelledby");r&&(s=s.concat(r.split(/\s+/)))});var l=o.filter(function(e){return""!==axe.commons.text.sanitize(e.textContent)&&("TH"===e.nodeName.toUpperCase()||-1!==["rowheader","columnheader"].indexOf(e.getAttribute("role")))}),u=n.toGrid(e);return!!l.reduce(function(e,t){if(t.getAttribute("id")&&s.includes(t.getAttribute("id")))return!!e||e;var r=!1,a=n.getCellPosition(t,u);return n.isColumnHeader(t)&&(r=n.traverse("down",a,u).reduce(function(e,t){return e||axe.commons.dom.hasContent(t)&&!n.isColumnHeader(t)},!1)),!r&&n.isRowHeader(t)&&(r=n.traverse("right",a,u).reduce(function(e,t){return e||axe.commons.dom.hasContent(t)&&!n.isRowHeader(t)},!1)),r||i.relatedNodes(t),e&&r},!0)||void 0}},{id:"hidden-content",evaluate:function(e,t,r,a){if(!["SCRIPT","HEAD","TITLE","NOSCRIPT","STYLE","TEMPLATE"].includes(e.tagName.toUpperCase())&&axe.commons.dom.hasContentVirtual(r)){var n=window.getComputedStyle(e);if("none"===n.getPropertyValue("display"))return;if("hidden"===n.getPropertyValue("visibility")){var o=axe.commons.dom.getComposedParent(e),i=o&&window.getComputedStyle(o);if(!i||"hidden"!==i.getPropertyValue("visibility"))return}}return!0}}],commons:function(){var commons={},u=commons.aria={},e=u.lookupTable={};e.attributes={"aria-activedescendant":{type:"idref"},"aria-atomic":{type:"boolean",values:["true","false"]},"aria-autocomplete":{type:"nmtoken",values:["inline","list","both","none"]},"aria-busy":{type:"boolean",values:["true","false"]},"aria-checked":{type:"nmtoken",values:["true","false","mixed","undefined"]},"aria-colcount":{type:"int"},"aria-colindex":{type:"int"},"aria-colspan":{type:"int"},"aria-controls":{type:"idrefs"},"aria-current":{type:"nmtoken",values:["page","step","location","date","time","true","false"]},"aria-describedby":{type:"idrefs"},"aria-disabled":{type:"boolean",values:["true","false"]},"aria-dropeffect":{type:"nmtokens",values:["copy","move","reference","execute","popup","none"]},"aria-errormessage":{type:"idref"},"aria-expanded":{type:"nmtoken",values:["true","false","undefined"]},"aria-flowto":{type:"idrefs"},"aria-grabbed":{type:"nmtoken",values:["true","false","undefined"]},"aria-haspopup":{type:"nmtoken",values:["true","false","menu","listbox","tree","grid","dialog"]},"aria-hidden":{type:"boolean",values:["true","false"]},"aria-invalid":{type:"nmtoken",values:["true","false","spelling","grammar"]},"aria-keyshortcuts":{type:"string"},"aria-label":{type:"string"},"aria-labelledby":{type:"idrefs"},"aria-level":{type:"int"},"aria-live":{type:"nmtoken",values:["off","polite","assertive"]},"aria-modal":{type:"boolean",values:["true","false"]},"aria-multiline":{type:"boolean",values:["true","false"]},"aria-multiselectable":{type:"boolean",values:["true","false"]},"aria-orientation":{type:"nmtoken",values:["horizontal","vertical"]},"aria-owns":{type:"idrefs"},"aria-placeholder":{type:"string"},"aria-posinset":{type:"int"},"aria-pressed":{type:"nmtoken",values:["true","false","mixed","undefined"]},"aria-readonly":{type:"boolean",values:["true","false"]},"aria-relevant":{type:"nmtokens",values:["additions","removals","text","all"]},"aria-required":{type:"boolean",values:["true","false"]},"aria-rowcount":{type:"int"},"aria-rowindex":{type:"int"},"aria-rowspan":{type:"int"},"aria-selected":{type:"nmtoken",values:["true","false","undefined"]},"aria-setsize":{type:"int"},"aria-sort":{type:"nmtoken",values:["ascending","descending","other","none"]},"aria-valuemax":{type:"decimal"},"aria-valuemin":{type:"decimal"},"aria-valuenow":{type:"decimal"},"aria-valuetext":{type:"string"}},e.globalAttributes=["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-disabled","aria-dropeffect","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant"];var t={CANNOT_HAVE_LIST_ATTRIBUTE:function(e){return!Array.from(e.attributes).map(function(e){return e.name.toUpperCase()}).includes("LIST")},CANNOT_HAVE_HREF_ATTRIBUTE:function(e){return!Array.from(e.attributes).map(function(e){return e.name.toUpperCase()}).includes("HREF")},MUST_HAVE_HREF_ATTRIBUTE:function(e){return!!e.href},MUST_HAVE_SIZE_ATTRIBUTE_WITH_VALUE_GREATER_THAN_1:function(e){return!!Array.from(e.attributes).map(function(e){return e.name.toUpperCase()}).includes("SIZE")&&1<Number(e.getAttribute("SIZE"))},MUST_HAVE_ALT_ATTRIBUTE:function(e){return!!Array.from(e.attributes).map(function(e){return e.name.toUpperCase()}).includes("ALT")},MUST_HAVE_ALT_ATTRIBUTE_WITH_VALUE:function(e){if(!Array.from(e.attributes).map(function(e){return e.name.toUpperCase()}).includes("ALT"))return!1;var t=e.getAttribute("ALT");return t&&0<t.length}};e.role={alert:{type:"widget",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},alertdialog:{type:"widget",attributes:{allowed:["aria-expanded","aria-modal","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["DIALOG","SECTION"]},application:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["ARTICLE","AUDIO","EMBED","IFRAME","OBJECT","SECTION","SVG","VIDEO"]},article:{type:"structure",attributes:{allowed:["aria-expanded","aria-posinset","aria-setsize","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["article"],unsupported:!1},banner:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["header"],unsupported:!1,allowedElements:["SECTION"]},button:{type:"widget",attributes:{allowed:["aria-expanded","aria-pressed","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,implicit:["button",'input[type="button"]','input[type="image"]','input[type="reset"]','input[type="submit"]',"summary"],unsupported:!1,allowedElements:[{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},cell:{type:"structure",attributes:{allowed:["aria-colindex","aria-colspan","aria-rowindex","aria-rowspan","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["row"],implicit:["td","th"],unsupported:!1},checkbox:{type:"widget",attributes:{allowed:["aria-checked","aria-required","aria-readonly","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,implicit:['input[type="checkbox"]'],unsupported:!1,allowedElements:["BUTTON"]},columnheader:{type:"structure",attributes:{allowed:["aria-colindex","aria-colspan","aria-expanded","aria-rowindex","aria-rowspan","aria-required","aria-readonly","aria-selected","aria-sort","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["row"],implicit:["th"],unsupported:!1},combobox:{type:"composite",attributes:{allowed:["aria-autocomplete","aria-required","aria-activedescendant","aria-orientation","aria-errormessage"],required:["aria-expanded"]},owned:{all:["listbox","textbox"]},nameFrom:["author"],context:null,unsupported:!1},command:{nameFrom:["author"],type:"abstract",unsupported:!1},complementary:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["aside"],unsupported:!1,allowedElements:["SECTION"]},composite:{nameFrom:["author"],type:"abstract",unsupported:!1},contentinfo:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["footer"],unsupported:!1,allowedElements:["SECTION"]},definition:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["dd","dfn"],unsupported:!1},dialog:{type:"widget",attributes:{allowed:["aria-expanded","aria-modal","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["dialog"],unsupported:!1,allowedElements:["SECTION"]},directory:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,unsupported:!1,allowedElements:["OL","UL"]},document:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["body"],unsupported:!1,allowedElements:["ARTICLE","EMBED","IFRAME","SECTION","SVG","OBJECT"]},"doc-abstract":{type:"section",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-acknowledgments":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-afterword":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-appendix":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-backlink":{type:"link",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,unsupported:!1,allowedElements:[{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},"doc-biblioentry":{type:"listitem",attributes:{allowed:["aria-expanded","aria-level","aria-posinset","aria-setsize","aria-errormessage"]},owned:null,nameFrom:["author"],context:["doc-bibliography"],unsupported:!1,allowedElements:["LI"]},"doc-bibliography":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-biblioref":{type:"link",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,unsupported:!1,allowedElements:[{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},"doc-chapter":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-colophon":{type:"section",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-conclusion":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-cover":{type:"img",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1},"doc-credit":{type:"section",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-credits":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-dedication":{type:"section",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-endnote":{type:"listitem",attributes:{allowed:["aria-expanded","aria-level","aria-posinset","aria-setsize","aria-errormessage"]},owned:null,namefrom:["author"],context:["doc-endnotes"],unsupported:!1,allowedElements:["LI"]},"doc-endnotes":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:["doc-endnote"],namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-epigraph":{type:"section",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1},"doc-epilogue":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-errata":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-example":{type:"section",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["ASIDE","SECTION"]},"doc-footnote":{type:"section",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["ASIDE","FOOTER","HEADER"]},"doc-foreword":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-glossary":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:["term","definition"],namefrom:["author"],context:null,unsupported:!1,allowedElements:["DL"]},"doc-glossref":{type:"link",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author","contents"],context:null,unsupported:!1,allowedElements:[{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},"doc-index":{type:"navigation",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["NAV","SECTION"]},"doc-introduction":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-noteref":{type:"link",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author","contents"],context:null,unsupported:!1,allowedElements:[{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},"doc-notice":{type:"note",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-pagebreak":{type:"separator",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["HR"]},"doc-pagelist":{type:"navigation",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["NAV","SECTION"]},"doc-part":{type:"landmark",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-preface":{type:"landmark",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-prologue":{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-pullquote":{type:"none",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["ASIDE","SECTION"]},"doc-qna":{type:"section",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},"doc-subtitle":{type:"sectionhead",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["H1","H2","H3","H4","H5","H6"]},"doc-tip":{type:"note",attributes:{allowed:["aria-expanded"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["ASIDE"]},"doc-toc":{type:"navigation",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,namefrom:["author"],context:null,unsupported:!1,allowedElements:["NAV","SECTION"]},feed:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:{one:["article"]},nameFrom:["author"],context:null,unsupported:!1,allowedElements:["ARTICLE","ASIDE","SECTION"]},figure:{type:"structure",unsupported:!0},form:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["form"],unsupported:!1},grid:{type:"composite",attributes:{allowed:["aria-activedescendant","aria-expanded","aria-colcount","aria-level","aria-multiselectable","aria-readonly","aria-rowcount","aria-errormessage"]},owned:{one:["rowgroup","row"]},nameFrom:["author"],context:null,implicit:["table"],unsupported:!1},gridcell:{type:"widget",attributes:{allowed:["aria-colindex","aria-colspan","aria-expanded","aria-rowindex","aria-rowspan","aria-selected","aria-readonly","aria-required","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["row"],implicit:["td","th"],unsupported:!1},group:{type:"structure",attributes:{allowed:["aria-activedescendant","aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["details","optgroup"],unsupported:!1,allowedElements:["DL","FIGCAPTION","FIELDSET","FIGURE","FOOTER","HEADER","OL","UL"]},heading:{type:"structure",attributes:{required:["aria-level"],allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,implicit:["h1","h2","h3","h4","h5","h6"],unsupported:!1},img:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["img"],unsupported:!1,allowedElements:["EMBED","IFRAME","OBJECT","SVG"]},input:{nameFrom:["author"],type:"abstract",unsupported:!1},landmark:{nameFrom:["author"],type:"abstract",unsupported:!1},link:{type:"widget",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,implicit:["a[href]"],unsupported:!1,allowedElements:["BUTTON",{tagName:"INPUT",attributes:{TYPE:"IMAGE"}},{tagName:"INPUT",attributes:{TYPE:"IMAGE"}}]},list:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:{all:["listitem"]},nameFrom:["author"],context:null,implicit:["ol","ul","dl"],unsupported:!1},listbox:{type:"composite",attributes:{allowed:["aria-activedescendant","aria-multiselectable","aria-required","aria-expanded","aria-orientation","aria-errormessage"]},owned:{all:["option"]},nameFrom:["author"],context:null,implicit:["select"],unsupported:!1,allowedElements:["OL","UL"]},listitem:{type:"structure",attributes:{allowed:["aria-level","aria-posinset","aria-setsize","aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["list"],implicit:["li","dt"],unsupported:!1},log:{type:"widget",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},main:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["main"],unsupported:!1,allowedElements:["ARTICLE","SECTION"]},marquee:{type:"widget",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},math:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["math"],unsupported:!1},menu:{type:"composite",attributes:{allowed:["aria-activedescendant","aria-expanded","aria-orientation","aria-errormessage"]},owned:{one:["menuitem","menuitemradio","menuitemcheckbox"]},nameFrom:["author"],context:null,implicit:['menu[type="context"]'],unsupported:!1,allowedElements:["OL","UL"]},menubar:{type:"composite",attributes:{allowed:["aria-activedescendant","aria-expanded","aria-orientation","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["OL","UL"]},menuitem:{type:"widget",attributes:{allowed:["aria-posinset","aria-setsize","aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["menu","menubar"],implicit:['menuitem[type="command"]'],unsupported:!1,allowedElements:["BUTTON","LI",{tagName:"INPUT",attributes:{TYPE:"IMAGE"}},{tagName:"INPUT",attributes:{TYPE:"BUTTON"}},{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},menuitemcheckbox:{type:"widget",attributes:{allowed:["aria-checked","aria-posinset","aria-setsize","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["menu","menubar"],implicit:['menuitem[type="checkbox"]'],unsupported:!1,allowedElements:["BUTTON","LI",{tagName:"INPUT",attributes:{TYPE:"CHECKBOX"}},{tagName:"INPUT",attributes:{TYPE:"IMAGE"}},{tagName:"INPUT",attributes:{TYPE:"BUTTON"}},{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},menuitemradio:{type:"widget",attributes:{allowed:["aria-checked","aria-selected","aria-posinset","aria-setsize","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["menu","menubar"],implicit:['menuitem[type="radio"]'],unsupported:!1,allowedElements:["BUTTON","LI",{tagName:"INPUT",attributes:{TYPE:"IMAGE"}},{tagName:"INPUT",attributes:{TYPE:"BUTTON"}},{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},navigation:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["nav"],unsupported:!1,allowedElements:["SECTION"]},none:{type:"structure",attributes:null,owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["ARTICLE","ASIDE","DL","EMBED","FIGCAPTION","FIELDSET","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","LI","SECTION","OL",{tagName:"IMG",condition:t.MUST_HAVE_ALT_ATTRIBUTE}]},note:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["ASIDE"]},option:{type:"widget",attributes:{allowed:["aria-selected","aria-posinset","aria-setsize","aria-checked","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["listbox"],implicit:["option"],unsupported:!1,allowedElements:["BUTTON","LI",{tagName:"INPUT",attributes:{TYPE:"CHECKBOX"}},{tagName:"INPUT",attributes:{TYPE:"BUTTON"}},{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},presentation:{type:"structure",attributes:null,owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["ARTICLE","ASIDE","DL","EMBED","FIGCAPTION","FIELDSET","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","OL","SECTION","UL",{tagName:"IMG",condition:t.MUST_HAVE_ALT_ATTRIBUTE}]},progressbar:{type:"widget",attributes:{allowed:["aria-valuetext","aria-valuenow","aria-valuemax","aria-valuemin","aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["progress"],unsupported:!1},radio:{type:"widget",attributes:{allowed:["aria-selected","aria-posinset","aria-setsize","aria-required","aria-errormessage"],required:["aria-checked"]},owned:null,nameFrom:["author","contents"],context:null,implicit:['input[type="radio"]'],unsupported:!1,allowedElements:["BUTTON","LI",{tagName:"INPUT",attributes:{TYPE:"IMAGE"}},{tagName:"INPUT",attributes:{TYPE:"BUTTON"}}]},radiogroup:{type:"composite",attributes:{allowed:["aria-activedescendant","aria-required","aria-expanded","aria-readonly","aria-errormessage"]},owned:{all:["radio"]},nameFrom:["author"],context:null,unsupported:!1,allowedElements:["OL","UL"]},range:{nameFrom:["author"],type:"abstract",unsupported:!1},region:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["section[aria-label]","section[aria-labelledby]","section[title]"],unsupported:!1,allowedElements:["ARTICLE","ASIDE"]},roletype:{type:"abstract",unsupported:!1},row:{type:"structure",attributes:{allowed:["aria-activedescendant","aria-colindex","aria-expanded","aria-level","aria-selected","aria-rowindex","aria-errormessage"]},owned:{one:["cell","columnheader","rowheader","gridcell"]},nameFrom:["author","contents"],context:["rowgroup","grid","treegrid","table"],implicit:["tr"],unsupported:!1},rowgroup:{type:"structure",attributes:{allowed:["aria-activedescendant","aria-expanded","aria-errormessage"]},owned:{all:["row"]},nameFrom:["author","contents"],context:["grid","table"],implicit:["tbody","thead","tfoot"],unsupported:!1},rowheader:{type:"structure",attributes:{allowed:["aria-colindex","aria-colspan","aria-expanded","aria-rowindex","aria-rowspan","aria-required","aria-readonly","aria-selected","aria-sort","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["row"],implicit:["th"],unsupported:!1},scrollbar:{type:"widget",attributes:{required:["aria-controls","aria-valuenow","aria-valuemax","aria-valuemin"],allowed:["aria-valuetext","aria-orientation","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1},search:{type:"landmark",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["ASIDE","FORM","SECTION"]},searchbox:{type:"widget",attributes:{allowed:["aria-activedescendant","aria-autocomplete","aria-multiline","aria-readonly","aria-required","aria-placeholder","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:['input[type="search"]'],unsupported:!1},section:{nameFrom:["author","contents"],type:"abstract",unsupported:!1},sectionhead:{nameFrom:["author","contents"],type:"abstract",unsupported:!1},select:{nameFrom:["author"],type:"abstract",unsupported:!1},separator:{type:"structure",attributes:{allowed:["aria-expanded","aria-orientation","aria-valuenow","aria-valuemax","aria-valuemin","aria-valuetext","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["hr"],unsupported:!1,allowedElements:["LI"]},slider:{type:"widget",attributes:{allowed:["aria-valuetext","aria-orientation","aria-readonly","aria-errormessage"],required:["aria-valuenow","aria-valuemax","aria-valuemin"]},owned:null,nameFrom:["author"],context:null,implicit:['input[type="range"]'],unsupported:!1},spinbutton:{type:"widget",attributes:{allowed:["aria-valuetext","aria-required","aria-readonly","aria-errormessage"],required:["aria-valuenow","aria-valuemax","aria-valuemin"]},owned:null,nameFrom:["author"],context:null,implicit:['input[type="number"]'],unsupported:!1},status:{type:"widget",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:["output"],unsupported:!1,allowedElements:["SECTION"]},structure:{type:"abstract",unsupported:!1},switch:{type:"widget",attributes:{allowed:["aria-errormessage"],required:["aria-checked"]},owned:null,nameFrom:["author","contents"],context:null,unsupported:!1,allowedElements:["BUTTON",{tagName:"INPUT",attributes:{TYPE:"CHECKBOX"}},{tagName:"INPUT",attributes:{TYPE:"IMAGE"}},{tagName:"INPUT",attributes:{TYPE:"BUTTON"}},{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},tab:{type:"widget",attributes:{allowed:["aria-selected","aria-expanded","aria-setsize","aria-posinset","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["tablist"],unsupported:!1,allowedElements:["BUTTON","H1","H2","H3","H4","H5","H6","LI",{tagName:"INPUT",attributes:{TYPE:"BUTTON"}},{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},table:{type:"structure",attributes:{allowed:["aria-colcount","aria-rowcount","aria-errormessage"]},owned:{one:["rowgroup","row"]},nameFrom:["author"],context:null,implicit:["table"],unsupported:!1},tablist:{type:"composite",attributes:{allowed:["aria-activedescendant","aria-expanded","aria-level","aria-multiselectable","aria-orientation","aria-errormessage"]},owned:{all:["tab"]},nameFrom:["author"],context:null,unsupported:!1,allowedElements:["OL","UL"]},tabpanel:{type:"widget",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1,allowedElements:["SECTION"]},term:{type:"structure",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,implicit:["dt"],unsupported:!1},textbox:{type:"widget",attributes:{allowed:["aria-activedescendant","aria-autocomplete","aria-multiline","aria-readonly","aria-required","aria-placeholder","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:['input[type="text"]','input[type="email"]','input[type="password"]','input[type="tel"]','input[type="url"]',"input:not([type])","textarea"],unsupported:!1},timer:{type:"widget",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,unsupported:!1},toolbar:{type:"structure",attributes:{allowed:["aria-activedescendant","aria-expanded","aria-orientation","aria-errormessage"]},owned:null,nameFrom:["author"],context:null,implicit:['menu[type="toolbar"]'],unsupported:!1,allowedElements:["OL","UL"]},tooltip:{type:"widget",attributes:{allowed:["aria-expanded","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:null,unsupported:!1},tree:{type:"composite",attributes:{allowed:["aria-activedescendant","aria-multiselectable","aria-required","aria-expanded","aria-orientation","aria-errormessage"]},owned:{all:["treeitem"]},nameFrom:["author"],context:null,unsupported:!1,allowedElements:["OL","UL"]},treegrid:{type:"composite",attributes:{allowed:["aria-activedescendant","aria-colcount","aria-expanded","aria-level","aria-multiselectable","aria-readonly","aria-required","aria-rowcount","aria-orientation","aria-errormessage"]},owned:{one:["rowgroup","row"]},nameFrom:["author"],context:null,unsupported:!1},treeitem:{type:"widget",attributes:{allowed:["aria-checked","aria-selected","aria-expanded","aria-level","aria-posinset","aria-setsize","aria-errormessage"]},owned:null,nameFrom:["author","contents"],context:["group","tree"],unsupported:!1,allowedElements:["LI",{tagName:"A",condition:t.MUST_HAVE_HREF_ATTRIBUTE}]},widget:{type:"abstract",unsupported:!1},window:{nameFrom:["author"],type:"abstract",unsupported:!1}},e.elementsAllowedNoRole=[{tagName:"AREA",condition:t.MUST_HAVE_HREF_ATTRIBUTE},"BASE","BODY","CAPTION","COL","COLGROUP","DATALIST","DD","DETAILS","DT","HEAD","HTML",{tagName:"INPUT",attributes:{TYPE:"COLOR"}},{tagName:"INPUT",attributes:{TYPE:"DATE"}},{tagName:"INPUT",attributes:{TYPE:"DATETIME"}},{tagName:"INPUT",condition:t.CANNOT_HAVE_LIST_ATTRIBUTE,attributes:{TYPE:"EMAIL"}},{tagName:"INPUT",attributes:{TYPE:"FILE"}},{tagName:"INPUT",attributes:{TYPE:"HIDDEN"}},{tagName:"INPUT",attributes:{TYPE:"MONTH"}},{tagName:"INPUT",attributes:{TYPE:"NUMBER"}},{tagName:"INPUT",attributes:{TYPE:"PASSWORD"}},{tagName:"INPUT",attributes:{TYPE:"RANGE"}},{tagName:"INPUT",attributes:{TYPE:"RESET"}},{tagName:"INPUT",condition:t.CANNOT_HAVE_LIST_ATTRIBUTE,attributes:{TYPE:"SEARCH"}},{tagName:"INPUT",attributes:{TYPE:"SUBMIT"}},{tagName:"INPUT",condition:t.CANNOT_HAVE_LIST_ATTRIBUTE,attributes:{TYPE:"TEL"}},{tagName:"INPUT",condition:t.CANNOT_HAVE_LIST_ATTRIBUTE,attributes:{TYPE:"TEXT"}},{tagName:"INPUT",attributes:{TYPE:"TIME"}},{tagName:"INPUT",condition:t.CANNOT_HAVE_LIST_ATTRIBUTE,attributes:{TYPE:"URL"}},{tagName:"INPUT",attributes:{TYPE:"WEEK"}},"KEYGEN","LABEL","LEGEND",{tagName:"LINK",attributes:{TYPE:"HREF"}},"MAIN","MAP","MATH",{tagName:"MENU",attributes:{TYPE:"CONTEXT"}},{tagName:"MENUITEM",attributes:{TYPE:"COMMAND"}},{tagName:"MENUITEM",attributes:{TYPE:"CHECKBOX"}},{tagName:"MENUITEM",attributes:{TYPE:"RADIO"}},"META","METER","NOSCRIPT","OPTGROUP","PARAM","PICTURE","PROGRESS","SCRIPT",{tagName:"SELECT",condition:t.MUST_HAVE_SIZE_ATTRIBUTE_WITH_VALUE_GREATER_THAN_1,attributes:{TYPE:"MULTIPLE"}},"SOURCE","STYLE","TEMPLATE","TEXTAREA","TITLE","TRACK","CLIPPATH","CURSOR","DEFS","DESC","FEBLEND","FECOLORMATRIX","FECOMPONENTTRANSFER","FECOMPOSITE","FECONVOLVEMATRIX","FEDIFFUSELIGHTING","FEDISPLACEMENTMAP","FEDISTANTLIGHT","FEDROPSHADOW","FEFLOOD","FEFUNCA","FEFUNCB","FEFUNCG","FEFUNCR","FEGAUSSIANBLUR","FEIMAGE","FEMERGE","FEMERGENODE","FEMORPHOLOGY","FEOFFSET","FEPOINTLIGHT","FESPECULARLIGHTING","FESPOTLIGHT","FETILE","FETURBULENCE","FILTER","HATCH","HATCHPATH","LINEARGRADIENT","MARKER","MASK","MESHGRADIENT","MESHPATCH","MESHROW","METADATA","MPATH","PATTERN","RADIALGRADIENT","SOLIDCOLOR","STOP","SWITCH","VIEW"],e.elementsAllowedAnyRole=[{tagName:"A",condition:t.CANNOT_HAVE_HREF_ATTRIBUTE},"ABBR","ADDRESS","CANVAS","DIV","P","PRE","BLOCKQUOTE","INS","DEL","OUTPUT","SPAN","TABLE","TBODY","THEAD","TFOOT","TD","EM","STRONG","SMALL","S","CITE","Q","DFN","ABBR","TIME","CODE","VAR","SAMP","KBD","SUB","SUP","I","B","U","MARK","RUBY","RT","RP","BDI","BDO","BR","WBR","TH","TR"],e.evaluateRoleForElement={A:function(e){var t=e.node,r=e.out;return"http://www.w3.org/2000/svg"===t.namespaceURI||(!t.href.length||r)},AREA:function(e){return!e.node.href},BUTTON:function(e){var t=e.node,r=e.role,a=e.out;return"menu"===t.getAttribute("type")?"menuitem"===r:a},IMG:function(e){var t=e.node,r=e.out;return t.alt?!r:r},INPUT:function(e){var t=e.node,r=e.role,a=e.out;switch(t.type){case"button":case"image":return a;case"checkbox":return!("button"!==r||!t.hasAttribute("aria-pressed"))||a;case"radio":return"menuitemradio"===r;default:return!1}},LI:function(e){var t=e.node,r=e.out;return!axe.utils.matchesSelector(t,"ol li, ul li")||r},LINK:function(e){return!e.node.href},MENU:function(e){return"context"!==e.node.getAttribute("type")},OPTION:function(e){var t=e.node;return!axe.utils.matchesSelector(t,"select > option, datalist > option, optgroup > option")},SELECT:function(e){var t=e.node,r=e.role;return!t.multiple&&t.size<=1&&"menu"===r},SVG:function(e){var t=e.node,r=e.out;return!(!t.parentNode||"http://www.w3.org/2000/svg"!==t.parentNode.namespaceURI)||r}};var c={};commons.color=c;var y=commons.dom={},o=commons.table={},v=commons.text={EdgeFormDefaults:{}};commons.utils=axe.utils;function i(e){return e.getPropertyValue("font-family").split(/[,;]/g).map(function(e){return e.trim().toLowerCase()})}u.requiredAttr=function(e){"use strict";var t=u.lookupTable.role[e];return t&&t.attributes&&t.attributes.required||[]},u.allowedAttr=function(e){"use strict";var t=u.lookupTable.role[e],r=t&&t.attributes&&t.attributes.allowed||[],a=t&&t.attributes&&t.attributes.required||[];return r.concat(u.lookupTable.globalAttributes).concat(a)},u.validateAttr=function(e){"use strict";return!!u.lookupTable.attributes[e]},u.validateAttrValue=function(e,t){"use strict";var r,a,n=e.getAttribute(t),o=u.lookupTable.attributes[t],i=y.getRootNode(e);if(!o)return!0;switch(o.type){case"boolean":case"nmtoken":return"string"==typeof n&&o.values.includes(n.toLowerCase());case"nmtokens":return(a=axe.utils.tokenList(n)).reduce(function(e,t){return e&&o.values.includes(t)},0!==a.length);case"idref":return 0===n.trim().length||!(!n||!i.getElementById(n));case"idrefs":return 0===n.trim().length||(a=axe.utils.tokenList(n)).some(function(e){return i.getElementById(e)});case"string":return!0;case"decimal":return!(!(r=n.match(/^[-+]?([0-9]*)\.?([0-9]*)$/))||!r[1]&&!r[2]);case"int":return/^[-+]?[0-9]+$/.test(n)}},u.getElementUnallowedRoles=function(t,r){var a=t.nodeName.toUpperCase();if(!axe.utils.isHtmlElement(t))return[];var e=function(e){var t=[];if(!e)return t;if(e.hasAttribute("role")){var r=axe.utils.tokenList(e.getAttribute("role").toLowerCase());t=t.concat(r)}if(e.hasAttributeNS("http://www.idpf.org/2007/ops","type")){var a=axe.utils.tokenList(e.getAttributeNS("http://www.idpf.org/2007/ops","type").toLowerCase()).map(function(e){return"doc-"+e});t=t.concat(a)}return t}(t),n=axe.commons.aria.implicitRole(t);return e.filter(function(e){return!!axe.commons.aria.isValidRole(e)&&(!(r||e!==n||"row"===e&&"TR"===a&&axe.utils.matchesSelector(t,'table[role="grid"] > tr'))||(!u.isAriaRoleAllowedOnElement(t,e)||void 0))})},u.getRole=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=t.noImplicit,a=t.fallback,n=t.abstracts,o=t.dpub,i=(e.getAttribute("role")||"").trim().toLowerCase(),s=(a?axe.utils.tokenList(i):[i]).filter(function(e){return!(!o&&"doc-"===e.substr(0,4))&&u.isValidRole(e,{allowAbstract:n})})[0];return s||r?s||null:u.implicitRole(e)},u.isAccessibleRef=function(e){e=e.actualNode||e;var t=y.getRootNode(e);t=t.documentElement||t;var a=e.id,n=Object.keys(u.lookupTable.attributes).filter(function(e){var t=u.lookupTable.attributes[e].type;return/^idrefs?$/.test(t)});return void 0!==function e(t,r){if(r(t))return t;for(var a=0;a<t.children.length;a++){var n=e(t.children[a],r);if(n)return n}}(t,function(r){if(1===r.nodeType)return"LABEL"===r.nodeName.toUpperCase()&&r.getAttribute("for")===a||n.filter(function(e){return r.hasAttribute(e)}).some(function(e){var t=r.getAttribute(e);return"idref"===u.lookupTable.attributes[e].type?t===a:axe.utils.tokenList(t).includes(a)})})},u.isAriaRoleAllowedOnElement=function(e,t){var r=e.nodeName.toUpperCase(),a=axe.commons.aria.lookupTable;if(u.validateNodeAndAttributes(e,a.elementsAllowedNoRole))return!1;if(u.validateNodeAndAttributes(e,a.elementsAllowedAnyRole))return!0;var n=a.role[t];if(!n)return!1;if(!(n.allowedElements&&Array.isArray(n.allowedElements)&&n.allowedElements.length))return!1;var o=!1;return o=u.validateNodeAndAttributes(e,n.allowedElements),Object.keys(a.evaluateRoleForElement).includes(r)&&(o=a.evaluateRoleForElement[r]({node:e,role:t,out:o})),o},u.labelVirtual=function(e){var t=e.actualNode,r=void 0;return t.getAttribute("aria-labelledby")&&(r=y.idrefs(t,"aria-labelledby").map(function(e){var t=axe.utils.getNodeFromTree(axe._tree[0],e);return t?v.visibleVirtual(t,!0):""}).join(" ").trim())?r:(r=t.getAttribute("aria-label"))&&(r=v.sanitize(r).trim())?r:null},u.label=function(e){return e=axe.utils.getNodeFromTree(axe._tree[0],e),u.labelVirtual(e)},u.isValidRole=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=t.allowAbstract,a=t.flagUnsupported,n=void 0!==a&&a,o=u.lookupTable.role[e],i=!!o&&o.unsupported;return!(!o||n&&i)&&(!!r||"abstract"!==o.type)},u.getRolesWithNameFromContents=function(){return Object.keys(u.lookupTable.role).filter(function(e){return u.lookupTable.role[e].nameFrom&&-1!==u.lookupTable.role[e].nameFrom.indexOf("contents")})},u.getRolesByType=function(t){return Object.keys(u.lookupTable.role).filter(function(e){return u.lookupTable.role[e].type===t})},u.getRoleType=function(e){var t=u.lookupTable.role[e];return t&&t.type||null},u.requiredOwned=function(e){"use strict";var t=null,r=u.lookupTable.role[e];return r&&(t=axe.utils.clone(r.owned)),t},u.requiredContext=function(e){"use strict";var t=null,r=u.lookupTable.role[e];return r&&(t=axe.utils.clone(r.context)),t},u.implicitNodes=function(e){"use strict";var t=null,r=u.lookupTable.role[e];return r&&r.implicit&&(t=axe.utils.clone(r.implicit)),t},u.implicitRole=function(r){"use strict";var e=Object.keys(u.lookupTable.role).map(function(e){var t=u.lookupTable.role[e];return{name:e,implicit:t&&t.implicit}}).reduce(function(e,t){return t.implicit&&t.implicit.some(function(e){return axe.utils.matchesSelector(r,e)})&&e.push(t.name),e},[]);if(!e.length)return null;for(var t,a,n=r.attributes,o=[],i=0,s=n.length;i<s;i++){var l=n[i];l.name.match(/^aria-/)&&o.push(l.name)}return(t=e,a=o,t.map(function(e){return{score:(t=e,u.allowedAttr(t).reduce(function(e,t){return e+(-1<a.indexOf(t)?1:0)},0)),name:e};var t}).sort(function(e,t){return t.score-e.score}).map(function(e){return e.name})).shift()},u.validateNodeAndAttributes=function(a,e){var t=a.nodeName.toUpperCase();if(e.filter(function(e){return"string"==typeof e}).includes(t))return!0;var r=e.filter(function(e){return"object"===(void 0===e?"undefined":T(e))}).filter(function(e){return e.tagName===t}),n=Array.from(a.attributes).map(function(e){return e.name.toUpperCase()}),o=r.filter(function(t){if(!t.attributes)return!!t.condition;var e=Object.keys(t.attributes);if(!e.length)return!1;var r=!1;return e.forEach(function(e){n.includes(e)&&(a.getAttribute(e).trim().toUpperCase()===t.attributes[e]&&(r=!0))}),r});if(!o.length)return!1;var i=!0;return o.forEach(function(e){e.condition&&"function"==typeof e.condition&&(i=e.condition(a))}),i},c.Color=function(e,t,r,a){this.red=e,this.green=t,this.blue=r,this.alpha=a,this.toHexString=function(){var e=Math.round(this.red).toString(16),t=Math.round(this.green).toString(16),r=Math.round(this.blue).toString(16);return"#"+(15.5<this.red?e:"0"+e)+(15.5<this.green?t:"0"+t)+(15.5<this.blue?r:"0"+r)};var n=/^rgb\((\d+), (\d+), (\d+)\)$/,o=/^rgba\((\d+), (\d+), (\d+), (\d*(\.\d+)?)\)/;this.parseRgbString=function(e){if("transparent"===e)return this.red=0,this.green=0,this.blue=0,void(this.alpha=0);var t=e.match(n);return t?(this.red=parseInt(t[1],10),this.green=parseInt(t[2],10),this.blue=parseInt(t[3],10),void(this.alpha=1)):(t=e.match(o))?(this.red=parseInt(t[1],10),this.green=parseInt(t[2],10),this.blue=parseInt(t[3],10),void(this.alpha=parseFloat(t[4]))):void 0},this.getRelativeLuminance=function(){var e=this.red/255,t=this.green/255,r=this.blue/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))}},c.flattenColors=function(e,t){var r=e.alpha,a=(1-r)*t.red+r*e.red,n=(1-r)*t.green+r*e.green,o=(1-r)*t.blue+r*e.blue,i=e.alpha+t.alpha*(1-e.alpha);return new c.Color(a,n,o,i)},c.getContrast=function(e,t){if(!t||!e)return null;t.alpha<1&&(t=c.flattenColors(t,e));var r=e.getRelativeLuminance(),a=t.getRelativeLuminance();return(Math.max(a,r)+.05)/(Math.min(a,r)+.05)},c.hasValidContrastRatio=function(e,t,r,a){var n=c.getContrast(e,t),o=a&&Math.ceil(72*r)/96<14||!a&&Math.ceil(72*r)/96<18?4.5:3;return{isValid:o<n,contrastRatio:n,expectedContrastRatio:o}},c.elementIsDistinct=function(e,t){var a=window.getComputedStyle(e);if("none"!==a.getPropertyValue("background-image"))return!0;if(["border-bottom","border-top","outline"].reduce(function(e,t){var r=new c.Color;return r.parseRgbString(a.getPropertyValue(t+"-color")),e||"none"!==a.getPropertyValue(t+"-style")&&0<parseFloat(a.getPropertyValue(t+"-width"))&&0!==r.alpha},!1))return!0;var r=window.getComputedStyle(t);if(i(a)[0]!==i(r)[0])return!0;var n=["text-decoration-line","text-decoration-style","font-weight","font-style","font-size"].reduce(function(e,t){return e||a.getPropertyValue(t)!==r.getPropertyValue(t)},!1),o=a.getPropertyValue("text-decoration");return o.split(" ").length<3&&(n=n||o!==r.getPropertyValue("text-decoration")),n};var r,s=["IMG","CANVAS","OBJECT","IFRAME","VIDEO","SVG"];function d(e,t){var r=e.nodeName.toUpperCase();if(s.includes(r))return axe.commons.color.incompleteData.set("bgColor","imgNode"),!0;var a=(t=t||window.getComputedStyle(e)).getPropertyValue("background-image"),n="none"!==a;if(n){var o=/gradient/.test(a);axe.commons.color.incompleteData.set("bgColor",o?"bgGradient":"bgImage")}return n}function m(e,t){t=t||window.getComputedStyle(e);var r=new c.Color;if(r.parseRgbString(t.getPropertyValue("background-color")),0!==r.alpha){var a=t.getPropertyValue("opacity");r.alpha=r.alpha*a}return r}function l(e,t){var r=e.getClientRects()[0],a=y.shadowElementsFromPoint(r.left,r.top);if(a)for(var n=0;n<a.length;n++)if(a[n]!==e&&a[n]===t)return!0;return!1}c.getCoords=function(e){if(!(e.left>window.innerWidth||e.top>window.innerHeight))return{x:Math.min(Math.ceil(e.left+e.width/2),window.innerWidth-1),y:Math.min(Math.ceil(e.top+e.height/2),window.innerHeight-1)}},c.getRectStack=function(e){var t=c.getCoords(e.getBoundingClientRect());if(t){var r=y.shadowElementsFromPoint(t.x,t.y),a=Array.from(e.getClientRects());if(a&&1<a.length){var n=a.filter(function(e){return e.width&&0<e.width}).map(function(e){var t=c.getCoords(e);if(t)return y.shadowElementsFromPoint(t.x,t.y)});return n.splice(0,0,r),n}return[r]}return null},c.filteredRectStack=function(n){var o=c.getRectStack(n);if(o&&1===o.length)return o[0];if(o&&1<o.length){var i=o.shift(),s=void 0;return o.forEach(function(e,t){if(0!==t){var r=o[t-1],a=o[t];s=r.every(function(e,t){return e===a[t]})||i.includes(n)}}),s?o[0]:(axe.commons.color.incompleteData.set("bgColor","elmPartiallyObscuring"),null)}return axe.commons.color.incompleteData.set("bgColor","outsideViewport"),null},c.getBackgroundStack=function(e){var t,r,a,n=c.filteredRectStack(e);if(null===n)return null;n=function(e,t){var r={TD:["TR","TBODY"],TH:["TR","THEAD"],INPUT:["LABEL"]},a=e.map(function(e){return e.tagName}),n=e;for(var o in r)if(a.includes(o))for(var i in r[o])if(o.hasOwnProperty(i)){var s=axe.commons.dom.findUp(t,r[o][i]);s&&-1===e.indexOf(s)&&axe.commons.dom.visuallyOverlaps(t.getBoundingClientRect(),s)&&n.splice(a.indexOf(o)+1,0,s),t.tagName===r[o][i]&&-1===a.indexOf(t.tagName)&&n.splice(a.indexOf(o)+1,0,t)}return n}(n,e),n=y.reduceToElementsBelowFloating(n,e),r=(t=n).indexOf(document.body),a=t,1<r&&!d(document.documentElement)&&0===m(document.documentElement).alpha&&(a.splice(r,1),a.splice(t.indexOf(document.documentElement),1),a.push(document.body));var o=(n=a).indexOf(e);return.99<=function(e,t,r){var a=0;if(0<e)for(var n=e-1;0<=n;n--){var o=t[n],i=m(o,window.getComputedStyle(o));i.alpha&&l(r,o)?a+=i.alpha:t.splice(n,1)}return a}(o,n,e)?(axe.commons.color.incompleteData.set("bgColor","bgOverlap"),null):-1!==o?n:null},c.getBackgroundColor=function(s){var l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];if(!0!==(2<arguments.length&&void 0!==arguments[2]&&arguments[2])){var e=s.clientHeight-2>=2*window.innerHeight;s.scrollIntoView(e)}var u=[],t=c.getBackgroundStack(s);return(t||[]).some(function(e){var t,r,a,n,o=window.getComputedStyle(e),i=m(e,o);return a=i,(n=(t=s)!==(r=e)&&!y.visuallyContains(t,r)&&0!==a.alpha)&&axe.commons.color.incompleteData.set("bgColor","elmPartiallyObscured"),n||d(e,o)?(u=null,l.push(e),!0):0!==i.alpha&&(l.push(e),u.push(i),1===i.alpha)}),null===u||null===t?null:(u.push(new c.Color(255,255,255,1)),u.reduce(c.flattenColors))},y.isOpaque=function(e){var t=window.getComputedStyle(e);return d(e,t)||1===m(e,t).alpha},c.getForegroundColor=function(e,t){var r=window.getComputedStyle(e),a=new c.Color;a.parseRgbString(r.getPropertyValue("color"));var n=r.getPropertyValue("opacity");if(a.alpha=a.alpha*n,1===a.alpha)return a;var o=c.getBackgroundColor(e,[],t);if(null!==o)return c.flattenColors(a,o);var i=axe.commons.color.incompleteData.get("bgColor");return axe.commons.color.incompleteData.set("fgColor",i),null},c.incompleteData=(r={},{set:function(e,t){if("string"!=typeof e)throw new Error("Incomplete data: key must be a string");return t&&(r[e]=t),r[e]},get:function(e){return r[e]},clear:function(){r={}}}),y.reduceToElementsBelowFloating=function(e,t){var r,a,n,o=["fixed","sticky"],i=[],s=!1;for(r=0;r<e.length;++r)(a=e[r])===t&&(s=!0),n=window.getComputedStyle(a),s||-1===o.indexOf(n.position)?i.push(a):i=[];return i},y.findElmsInContext=function(e){var t=e.context,r=e.value,a=e.attr,n=e.elm,o=void 0===n?"":n,i=void 0,s=axe.utils.escapeSelector(r);return i=9===t.nodeType||11===t.nodeType?t:y.getRootNode(t),Array.from(i.querySelectorAll(o+"["+a+"="+s+"]"))},y.findUp=function(e,t){return y.findUpVirtual(axe.utils.getNodeFromTree(axe._tree[0],e),t)},y.findUpVirtual=function(e,t){var r=void 0;if(r=e.actualNode,!e.shadowId&&"function"==typeof e.actualNode.closest){var a=e.actualNode.closest(t);return a||null}for(;(r=r.assignedSlot?r.assignedSlot:r.parentNode)&&11===r.nodeType&&(r=r.host),r&&!axe.utils.matchesSelector(r,t)&&r!==document.documentElement;);return axe.utils.matchesSelector(r,t)?r:null},y.getComposedParent=function e(t){if(t.assignedSlot)return e(t.assignedSlot);if(t.parentNode){var r=t.parentNode;if(1===r.nodeType)return r;if(r.host)return r.host}return null},y.getElementByReference=function(e,t){var r=e.getAttribute(t);if(r&&"#"===r.charAt(0)){r=decodeURIComponent(r.substring(1));var a=document.getElementById(r);if(a)return a;if((a=document.getElementsByName(r)).length)return a[0]}return null},y.getElementCoordinates=function(e){"use strict";var t=y.getScrollOffset(document),r=t.left,a=t.top,n=e.getBoundingClientRect();return{top:n.top+a,right:n.right+r,bottom:n.bottom+a,left:n.left+r,width:n.right-n.left,height:n.bottom-n.top}},y.getRootNode=axe.utils.getRootNode,y.getScrollOffset=function(e){"use strict";if(!e.nodeType&&e.document&&(e=e.document),9!==e.nodeType)return{left:e.scrollLeft,top:e.scrollTop};var t=e.documentElement,r=e.body;return{left:t&&t.scrollLeft||r&&r.scrollLeft||0,top:t&&t.scrollTop||r&&r.scrollTop||0}},y.getViewportSize=function(e){"use strict";var t,r=e.document,a=r.documentElement;return e.innerWidth?{width:e.innerWidth,height:e.innerHeight}:a?{width:a.clientWidth,height:a.clientHeight}:{width:(t=r.body).clientWidth,height:t.clientHeight}};var a=["HEAD","TITLE","TEMPLATE","SCRIPT","STYLE","IFRAME","OBJECT","VIDEO","AUDIO","NOSCRIPT"];function n(e){return e.disabled||!y.isVisible(e,!0)&&"AREA"!==e.nodeName.toUpperCase()}y.hasContentVirtual=function(e,t){return function(e){if(!a.includes(e.actualNode.nodeName.toUpperCase()))return e.children.some(function(e){var t=e.actualNode;return 3===t.nodeType&&t.nodeValue.trim()})}(e)||y.isVisualContent(e.actualNode)||!!u.labelVirtual(e)||!t&&e.children.some(function(e){return 1===e.actualNode.nodeType&&y.hasContentVirtual(e)})},y.hasContent=function(e,t){return e=axe.utils.getNodeFromTree(axe._tree[0],e),y.hasContentVirtual(e,t)},y.idrefs=function(e,t){"use strict";var r,a,n=y.getRootNode(e),o=[],i=e.getAttribute(t);if(i)for(r=0,a=(i=axe.utils.tokenList(i)).length;r<a;r++)o.push(n.getElementById(i[r]));return o},y.isFocusable=function(e){"use strict";if(n(e))return!1;if(y.isNativelyFocusable(e))return!0;var t=e.getAttribute("tabindex");return!(!t||isNaN(parseInt(t,10)))},y.isNativelyFocusable=function(e){"use strict";if(!e||n(e))return!1;switch(e.nodeName.toUpperCase()){case"A":case"AREA":if(e.href)return!0;break;case"INPUT":return"hidden"!==e.type;case"TEXTAREA":case"SELECT":case"DETAILS":case"BUTTON":return!0}return!1},y.insertedIntoFocusOrder=function(e){return-1<e.tabIndex&&y.isFocusable(e)&&!y.isNativelyFocusable(e)},y.isHTML5=function(e){var t=e.doctype;return null!==t&&("html"===t.name&&!t.publicId&&!t.systemId)};var p=["block","list-item","table","flex","grid","inline-block"];function f(e){var t=window.getComputedStyle(e).getPropertyValue("display");return p.includes(t)||"table-"===t.substr(0,6)}y.isInTextBlock=function(r){if(f(r))return!1;var e=function(e){for(var t=y.getComposedParent(e);t&&!f(t);)t=y.getComposedParent(t);return axe.utils.getNodeFromTree(axe._tree[0],t)}(r),a="",n="",o=0;return function t(e,r){!1!==r(e.actualNode)&&e.children.forEach(function(e){return t(e,r)})}(e,function(e){if(2===o)return!1;if(3===e.nodeType&&(a+=e.nodeValue),1===e.nodeType){var t=(e.nodeName||"").toUpperCase();if(["BR","HR"].includes(t))0===o?n=a="":o=2;else{if("none"===e.style.display||"hidden"===e.style.overflow||!["",null,"none"].includes(e.style.float)||!["",null,"relative"].includes(e.style.position))return!1;if("A"===t&&e.href||"link"===(e.getAttribute("role")||"").toLowerCase())return e===r&&(o=1),n+=e.textContent,!1}}}),a=axe.commons.text.sanitize(a),n=axe.commons.text.sanitize(n),a.length>n.length},y.isNode=function(e){"use strict";return e instanceof Node},y.isOffscreen=function(e){var t=void 0,r=document.documentElement,a=window.getComputedStyle(e),n=window.getComputedStyle(document.body||r).getPropertyValue("direction"),o=y.getElementCoordinates(e);if(o.bottom<0&&(function(e,t){for(e=y.getComposedParent(e);e&&"html"!==e.nodeName.toLowerCase();){if(e.scrollTop&&0<=(t+=e.scrollTop))return!1;e=y.getComposedParent(e)}return!0}(e,o.bottom)||"absolute"===a.position))return!0;if(0===o.left&&0===o.right)return!1;if("ltr"===n){if(o.right<=0)return!0}else if(t=Math.max(r.scrollWidth,y.getViewportSize(window).width),o.left>=t)return!0;return!1},y.isVisible=function(e,t,r){"use strict";var a,n,o,i,s;return 9===e.nodeType||(11===e.nodeType&&(e=e.host),null!==(a=window.getComputedStyle(e,null))&&(n=e.nodeName.toUpperCase(),!("none"===a.getPropertyValue("display")||"STYLE"===n.toUpperCase()||"SCRIPT"===n.toUpperCase()||!t&&(i=a.getPropertyValue("clip"),(s=i.match(/rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/))&&5===s.length&&s[3]-s[1]<=0&&s[2]-s[4]<=0)||!r&&("hidden"===a.getPropertyValue("visibility")||!t&&y.isOffscreen(e))||t&&"true"===e.getAttribute("aria-hidden"))&&(!!(o=e.assignedSlot?e.assignedSlot:e.parentNode)&&y.isVisible(o,t,!0))))};var h=["checkbox","img","radio","range","slider","spinbutton","textbox"];y.isVisualContent=function(e){var t=e.getAttribute("role");if(t)return-1!==h.indexOf(t);switch(e.tagName.toUpperCase()){case"IMG":case"IFRAME":case"OBJECT":case"VIDEO":case"AUDIO":case"CANVAS":case"SVG":case"MATH":case"BUTTON":case"SELECT":case"TEXTAREA":case"KEYGEN":case"PROGRESS":case"METER":return!0;case"INPUT":return"hidden"!==e.type;default:return!1}},y.shadowElementsFromPoint=function(a,n){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document,o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;if(999<o)throw new Error("Infinite loop detected");return Array.from(t.elementsFromPoint(a,n)).filter(function(e){return y.getRootNode(e)===t}).reduce(function(e,t){if(axe.utils.isShadowRoot(t)){var r=y.shadowElementsFromPoint(a,n,t.shadowRoot,o+1);(e=e.concat(r)).length&&axe.commons.dom.visuallyContains(e[0],t)&&e.push(t)}else e.push(t);return e},[])},y.visuallyContains=function(e,t){var r=e.getBoundingClientRect(),a=r.top+.01,n=r.bottom-.01,o=r.left+.01,i=r.right-.01,s=t.getBoundingClientRect(),l=s.top,u=s.left,c=l-t.scrollTop,d=l-t.scrollTop+t.scrollHeight,m=u-t.scrollLeft,p=u-t.scrollLeft+t.scrollWidth,f=window.getComputedStyle(t);return"inline"===f.getPropertyValue("display")||!(o<m&&o<s.left||a<c&&a<s.top||p<i&&i>s.right||d<n&&n>s.bottom)&&(!(i>s.right||n>s.bottom)||("scroll"===f.overflow||"auto"===f.overflow||"hidden"===f.overflow||t instanceof HTMLBodyElement||t instanceof HTMLHtmlElement))},y.visuallyOverlaps=function(e,t){var r=t.getBoundingClientRect(),a=r.top,n=r.left,o=a-t.scrollTop,i=a-t.scrollTop+t.scrollHeight,s=n-t.scrollLeft,l=n-t.scrollLeft+t.scrollWidth;if(e.left>l&&e.left>r.right||e.top>i&&e.top>r.bottom||e.right<s&&e.right<r.left||e.bottom<o&&e.bottom<r.top)return!1;var u=window.getComputedStyle(t);return!(e.left>r.right||e.top>r.bottom)||("scroll"===u.overflow||"auto"===u.overflow||t instanceof HTMLBodyElement||t instanceof HTMLHtmlElement)},o.getAllCells=function(e){var t,r,a,n,o=[];for(t=0,a=e.rows.length;t<a;t++)for(r=0,n=e.rows[t].cells.length;r<n;r++)o.push(e.rows[t].cells[r]);return o},o.getCellPosition=function(e,t){var r,a;for(t||(t=o.toGrid(y.findUp(e,"table"))),r=0;r<t.length;r++)if(t[r]&&-1!==(a=t[r].indexOf(e)))return{x:a,y:r}},o.getHeaders=function(e){if(e.hasAttribute("headers"))return commons.dom.idrefs(e,"headers");var t=commons.table.toGrid(commons.dom.findUp(e,"table")),r=commons.table.getCellPosition(e,t),a=o.traverse("left",r,t).filter(function(e){return o.isRowHeader(e)}),n=o.traverse("up",r,t).filter(function(e){return o.isColumnHeader(e)});return[].concat(a,n).reverse()},o.getScope=function(e){var t=e.getAttribute("scope"),r=e.getAttribute("role");if(e instanceof Element==!1||-1===["TD","TH"].indexOf(e.nodeName.toUpperCase()))throw new TypeError("Expected TD or TH element");if("columnheader"===r)return"col";if("rowheader"===r)return"row";if("col"===t||"row"===t)return t;if("TH"!==e.nodeName.toUpperCase())return!1;var a=o.toGrid(y.findUp(e,"table")),n=o.getCellPosition(e);return a[n.y].reduce(function(e,t){return e&&"TH"===t.nodeName.toUpperCase()},!0)?"col":a.map(function(e){return e[n.x]}).reduce(function(e,t){return e&&"TH"===t.nodeName.toUpperCase()},!0)?"row":"auto"},o.isColumnHeader=function(e){return-1!==["col","auto"].indexOf(o.getScope(e))},o.isDataCell=function(e){if(!e.children.length&&!e.textContent.trim())return!1;var t=e.getAttribute("role");return axe.commons.aria.isValidRole(t)?["cell","gridcell"].includes(t):"TD"===e.nodeName.toUpperCase()},o.isDataTable=function(e){var t=(e.getAttribute("role")||"").toLowerCase();if(("presentation"===t||"none"===t)&&!y.isFocusable(e))return!1;if("true"===e.getAttribute("contenteditable")||y.findUp(e,'[contenteditable="true"]'))return!0;if("grid"===t||"treegrid"===t||"table"===t)return!0;if("landmark"===commons.aria.getRoleType(t))return!0;if("0"===e.getAttribute("datatable"))return!1;if(e.getAttribute("summary"))return!0;if(e.tHead||e.tFoot||e.caption)return!0;for(var r=0,a=e.children.length;r<a;r++)if("COLGROUP"===e.children[r].nodeName.toUpperCase())return!0;for(var n,o,i=0,s=e.rows.length,l=!1,u=0;u<s;u++)for(var c=0,d=(n=e.rows[u]).cells.length;c<d;c++){if("TH"===(o=n.cells[c]).nodeName.toUpperCase())return!0;if(l||o.offsetWidth===o.clientWidth&&o.offsetHeight===o.clientHeight||(l=!0),o.getAttribute("scope")||o.getAttribute("headers")||o.getAttribute("abbr"))return!0;if(["columnheader","rowheader"].includes((o.getAttribute("role")||"").toLowerCase()))return!0;if(1===o.children.length&&"ABBR"===o.children[0].nodeName.toUpperCase())return!0;i++}if(e.getElementsByTagName("table").length)return!1;if(s<2)return!1;var m,p,f=e.rows[Math.ceil(s/2)];if(1===f.cells.length&&1===f.cells[0].colSpan)return!1;if(5<=f.cells.length)return!0;if(l)return!0;for(u=0;u<s;u++){if(n=e.rows[u],m&&m!==window.getComputedStyle(n).getPropertyValue("background-color"))return!0;if(m=window.getComputedStyle(n).getPropertyValue("background-color"),p&&p!==window.getComputedStyle(n).getPropertyValue("background-image"))return!0;p=window.getComputedStyle(n).getPropertyValue("background-image")}return 20<=s||!(y.getElementCoordinates(e).width>.95*y.getViewportSize(window).width)&&(!(i<10)&&!e.querySelector("object, embed, iframe, applet"))},o.isHeader=function(e){if(o.isColumnHeader(e)||o.isRowHeader(e))return!0;if(e.getAttribute("id")){var t=axe.utils.escapeSelector(e.getAttribute("id"));return!!document.querySelector('[headers~="'+t+'"]')}return!1},o.isRowHeader=function(e){return["row","auto"].includes(o.getScope(e))},o.toGrid=function(e){for(var t=[],r=e.rows,a=0,n=r.length;a<n;a++){var o=r[a].cells;t[a]=t[a]||[];for(var i=0,s=0,l=o.length;s<l;s++)for(var u=0;u<o[s].colSpan;u++){for(var c=0;c<o[s].rowSpan;c++){for(t[a+c]=t[a+c]||[];t[a+c][i];)i++;t[a+c][i]=o[s]}i++}}return t},o.toArray=o.toGrid,o.traverse=function(e,t,r,a){if(Array.isArray(t)&&(a=r,r=t,t={x:0,y:0}),"string"==typeof e)switch(e){case"left":e={x:-1,y:0};break;case"up":e={x:0,y:-1};break;case"right":e={x:1,y:0};break;case"down":e={x:0,y:1}}return function e(t,r,a,n){var o,i=a[r.y]?a[r.y][r.x]:void 0;return i?"function"==typeof n&&!0===(o=n(i,r,a))?[i]:((o=e(t,{x:r.x+t.x,y:r.y+t.y},a,n)).unshift(i),o):[]}(e,{x:t.x+e.x,y:t.y+e.y},r,a)};var w={submit:"Submit",reset:"Reset"},k=["text","search","tel","url","email","date","time","number","range","color"],x=["A","EM","STRONG","SMALL","MARK","ABBR","DFN","I","B","S","U","CODE","VAR","SAMP","KBD","SUP","SUB","Q","CITE","SPAN","BDO","BDI","BR","WBR","INS","DEL","IMG","EMBED","OBJECT","IFRAME","MAP","AREA","SCRIPT","NOSCRIPT","RUBY","VIDEO","AUDIO","INPUT","TEXTAREA","SELECT","BUTTON","LABEL","OUTPUT","DATALIST","KEYGEN","PROGRESS","COMMAND","CANVAS","TIME","METER"];function E(e,t){var r=e.actualNode.querySelector(t.toLowerCase());return r?v.accessibleText(r):""}function A(e){return!!v.sanitize(e)}v.accessibleText=function(e,t){var r=axe.utils.getNodeFromTree(axe._tree[0],e);return axe.commons.text.accessibleTextVirtual(r,t)},v.accessibleTextVirtual=function(e,t){var g=void 0,i=[];function b(e,a,n){return e.children.reduce(function(e,t){var r=t.actualNode;return 3===r.nodeType?e+=r.nodeValue:1===r.nodeType&&(x.includes(r.nodeName.toUpperCase())||(e+=" "),e+=g(t,a,n)),e},"")}function s(e,t,r){var a,n,o,i,s,l,u,c,d,m="",p=e.actualNode,f=p.nodeName.toUpperCase();if(a=e.actualNode,["BUTTON","SUMMARY","A"].includes(a.nodeName.toUpperCase())&&A(m=b(e,!1,!1)||""))return m;if("FIGURE"===f&&A(m=E(e,"figcaption")))return m;if("TABLE"===f){if(A(m=E(e,"caption")))return m;if(A(m=p.getAttribute("title")||p.getAttribute("summary")||(n=e,axe.commons.table.isDataTable(n.actualNode)||1!==axe.commons.table.getAllCells(n.actualNode).length?"":b(n,!1,!1).trim())||""))return m}if(o=e.actualNode,i=o.nodeName.toUpperCase(),["IMG","APPLET","AREA"].includes(i)||"INPUT"===i&&"image"===o.type.toLowerCase())return p.getAttribute("alt")||"";if(c=e.actualNode,("TEXTAREA"===(d=c.nodeName.toUpperCase())||"SELECT"===d||"INPUT"===d&&"hidden"!==c.type.toLowerCase())&&!r){if(u=e.actualNode,["button","reset","submit"].includes(u.type.toLowerCase()))return p.value||p.title||w[p.type]||"";var h=(l=void 0,(s=e).actualNode.id&&(l=y.findElmsInContext({elm:"label",attr:"for",value:s.actualNode.id,context:s.actualNode})[0]),l||(l=y.findUpVirtual(s,"label")),axe.utils.getNodeFromTree(axe._tree[0],l));if(h)return g(h,t,!0)}return""}function l(e,t,r){var a="",n=e.actualNode;return!t&&n.hasAttribute("aria-labelledby")&&(a=v.sanitize(y.idrefs(n,"aria-labelledby").map(function(e){if(null===e)return"";n===e&&i.pop();var t=axe.utils.getNodeFromTree(axe._tree[0],e);return g(t,!0,n!==e)}).join(" "))),a||r&&function(e){if(!e)return!1;var t=e.actualNode;switch(t.nodeName.toUpperCase()){case"SELECT":case"TEXTAREA":return!0;case"INPUT":return!t.hasAttribute("type")||k.includes(t.getAttribute("type").toLowerCase());default:return!1}}(e)||!n.hasAttribute("aria-label")?a:v.sanitize(n.getAttribute("aria-label"))}return e instanceof Node&&(e=axe.utils.getNodeFromTree(axe._tree[0],e)),g=function(e,t,r){var a=void 0;if(!e||i.includes(e))return"";if(null!==e&&e.actualNode instanceof Node!=!0)throw new Error("Invalid argument. Virtual Node must be provided");if(!t&&!y.isVisible(e.actualNode,!0))return"";i.push(e);var n,o=e.actualNode.getAttribute("role");return A(a=l(e,t,r))?a:A(a=s(e,t,r))?a:r&&A(a=function(e,t){var r=e.actualNode,a=r.nodeName.toUpperCase();if("INPUT"===a)return!r.hasAttribute("type")||k.includes(r.type.toLowerCase())?r.value:"";if("SELECT"===a&&t){var n=r.options;if(n&&n.length){for(var o="",i=0;i<n.length;i++)n[i].selected&&(o+=" "+n[i].text);return v.sanitize(o)}return""}return"TEXTAREA"===a&&r.value?r.value:""}(e,t))?a:!t&&(n=e.actualNode,["TABLE","FIGURE","SELECT"].includes(n.nodeName.toUpperCase()))||o&&-1===u.getRolesWithNameFromContents().indexOf(o)||!A(a=b(e,t,r))?e.actualNode.hasAttribute("title")?e.actualNode.getAttribute("title"):"":a},v.sanitize(g(e,t))};v.autocomplete={stateTerms:["on","off"],standaloneTerms:["name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","username","new-password","current-password","organization-title","organization","street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","url","photo"],qualifiers:["home","work","mobile","fax","pager"],qualifiedTerms:["tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-local-prefix","tel-local-suffix","tel-extension","email","impp"],locations:["billing","shipping"]},v.isValidAutocomplete=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=t.looseTyped,a=void 0!==r&&r,n=t.stateTerms,o=void 0===n?[]:n,i=t.locations,s=void 0===i?[]:i,l=t.qualifiers,u=void 0===l?[]:l,c=t.standaloneTerms,d=void 0===c?[]:c,m=t.qualifiedTerms,p=void 0===m?[]:m;if(e=e.toLowerCase().trim(),(o=o.concat(v.autocomplete.stateTerms)).includes(e)||""===e)return!0;u=u.concat(v.autocomplete.qualifiers),s=s.concat(v.autocomplete.locations),d=d.concat(v.autocomplete.standaloneTerms),p=p.concat(v.autocomplete.qualifiedTerms);var f=e.split(/\s+/g);if(!a&&(8<f[0].length&&"section-"===f[0].substr(0,8)&&f.shift(),s.includes(f[0])&&f.shift(),u.includes(f[0])&&(f.shift(),d=[]),1!==f.length))return!1;var h=f[f.length-1];return d.includes(h)||p.includes(h)},v.labelVirtual=function(e){var t,r;if(r=u.labelVirtual(e))return r;if(e.actualNode.id){var a=axe.commons.utils.escapeSelector(e.actualNode.getAttribute("id"));if(r=(t=axe.commons.dom.getRootNode(e.actualNode).querySelector('label[for="'+a+'"]'))&&v.visible(t,!0))return r}return(r=(t=y.findUpVirtual(e,"label"))&&v.visible(t,!0))||null},v.label=function(e){return e=axe.utils.getNodeFromTree(axe._tree[0],e),v.labelVirtual(e)},v.sanitize=function(e){"use strict";return e.replace(/\r\n/g,"\n").replace(/\u00A0/g," ").replace(/[\s]{2,}/g," ").trim()},v.visibleVirtual=function(r,a,n){var e=r.children.map(function(e){if(3===e.actualNode.nodeType){var t=e.actualNode.nodeValue;if(t&&y.isVisible(r.actualNode,a))return t}else if(!n)return v.visibleVirtual(e,a)}).join("");return v.sanitize(e)},v.visible=function(e,t,r){return e=axe.utils.getNodeFromTree(axe._tree[0],e),v.visibleVirtual(e,t,r)},axe.utils.getBaseLang=function(e){return e?e.trim().split("-")[0].toLowerCase():""};var g=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];axe.utils.isHtmlElement=function(e){var t=e.nodeName.toLowerCase();return g.includes(t)&&"http://www.w3.org/2000/svg"!==e.namespaceURI},axe.utils.tokenList=function(e){"use strict";return e.trim().replace(/\s{2,}/g," ").split(" ")};var b=["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","in","io","is","it","iu","iw","ja","ji","jv","jw","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mo","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","sh","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu","aaa","aab","aac","aad","aae","aaf","aag","aah","aai","aak","aal","aam","aan","aao","aap","aaq","aas","aat","aau","aav","aaw","aax","aaz","aba","abb","abc","abd","abe","abf","abg","abh","abi","abj","abl","abm","abn","abo","abp","abq","abr","abs","abt","abu","abv","abw","abx","aby","abz","aca","acb","acd","ace","acf","ach","aci","ack","acl","acm","acn","acp","acq","acr","acs","act","acu","acv","acw","acx","acy","acz","ada","adb","add","ade","adf","adg","adh","adi","adj","adl","adn","ado","adp","adq","adr","ads","adt","adu","adw","adx","ady","adz","aea","aeb","aec","aed","aee","aek","ael","aem","aen","aeq","aer","aes","aeu","aew","aey","aez","afa","afb","afd","afe","afg","afh","afi","afk","afn","afo","afp","afs","aft","afu","afz","aga","agb","agc","agd","age","agf","agg","agh","agi","agj","agk","agl","agm","agn","ago","agp","agq","agr","ags","agt","agu","agv","agw","agx","agy","agz","aha","ahb","ahg","ahh","ahi","ahk","ahl","ahm","ahn","aho","ahp","ahr","ahs","aht","aia","aib","aic","aid","aie","aif","aig","aih","aii","aij","aik","ail","aim","ain","aio","aip","aiq","air","ais","ait","aiw","aix","aiy","aja","ajg","aji","ajn","ajp","ajt","aju","ajw","ajz","akb","akc","akd","ake","akf","akg","akh","aki","akj","akk","akl","akm","ako","akp","akq","akr","aks","akt","aku","akv","akw","akx","aky","akz","ala","alc","ald","ale","alf","alg","alh","ali","alj","alk","all","alm","aln","alo","alp","alq","alr","als","alt","alu","alv","alw","alx","aly","alz","ama","amb","amc","ame","amf","amg","ami","amj","amk","aml","amm","amn","amo","amp","amq","amr","ams","amt","amu","amv","amw","amx","amy","amz","ana","anb","anc","and","ane","anf","ang","anh","ani","anj","ank","anl","anm","ann","ano","anp","anq","anr","ans","ant","anu","anv","anw","anx","any","anz","aoa","aob","aoc","aod","aoe","aof","aog","aoh","aoi","aoj","aok","aol","aom","aon","aor","aos","aot","aou","aox","aoz","apa","apb","apc","apd","ape","apf","apg","aph","api","apj","apk","apl","apm","apn","apo","app","apq","apr","aps","apt","apu","apv","apw","apx","apy","apz","aqa","aqc","aqd","aqg","aql","aqm","aqn","aqp","aqr","aqt","aqz","arb","arc","ard","are","arh","ari","arj","ark","arl","arn","aro","arp","arq","arr","ars","art","aru","arv","arw","arx","ary","arz","asa","asb","asc","asd","ase","asf","asg","ash","asi","asj","ask","asl","asn","aso","asp","asq","asr","ass","ast","asu","asv","asw","asx","asy","asz","ata","atb","atc","atd","ate","atg","ath","ati","atj","atk","atl","atm","atn","ato","atp","atq","atr","ats","att","atu","atv","atw","atx","aty","atz","aua","aub","auc","aud","aue","auf","aug","auh","aui","auj","auk","aul","aum","aun","auo","aup","auq","aur","aus","aut","auu","auw","aux","auy","auz","avb","avd","avi","avk","avl","avm","avn","avo","avs","avt","avu","avv","awa","awb","awc","awd","awe","awg","awh","awi","awk","awm","awn","awo","awr","aws","awt","awu","awv","aww","awx","awy","axb","axe","axg","axk","axl","axm","axx","aya","ayb","ayc","ayd","aye","ayg","ayh","ayi","ayk","ayl","ayn","ayo","ayp","ayq","ayr","ays","ayt","ayu","ayx","ayy","ayz","aza","azb","azc","azd","azg","azj","azm","azn","azo","azt","azz","baa","bab","bac","bad","bae","baf","bag","bah","bai","baj","bal","ban","bao","bap","bar","bas","bat","bau","bav","baw","bax","bay","baz","bba","bbb","bbc","bbd","bbe","bbf","bbg","bbh","bbi","bbj","bbk","bbl","bbm","bbn","bbo","bbp","bbq","bbr","bbs","bbt","bbu","bbv","bbw","bbx","bby","bbz","bca","bcb","bcc","bcd","bce","bcf","bcg","bch","bci","bcj","bck","bcl","bcm","bcn","bco","bcp","bcq","bcr","bcs","bct","bcu","bcv","bcw","bcy","bcz","bda","bdb","bdc","bdd","bde","bdf","bdg","bdh","bdi","bdj","bdk","bdl","bdm","bdn","bdo","bdp","bdq","bdr","bds","bdt","bdu","bdv","bdw","bdx","bdy","bdz","bea","beb","bec","bed","bee","bef","beg","beh","bei","bej","bek","bem","beo","bep","beq","ber","bes","bet","beu","bev","bew","bex","bey","bez","bfa","bfb","bfc","bfd","bfe","bff","bfg","bfh","bfi","bfj","bfk","bfl","bfm","bfn","bfo","bfp","bfq","bfr","bfs","bft","bfu","bfw","bfx","bfy","bfz","bga","bgb","bgc","bgd","bge","bgf","bgg","bgi","bgj","bgk","bgl","bgm","bgn","bgo","bgp","bgq","bgr","bgs","bgt","bgu","bgv","bgw","bgx","bgy","bgz","bha","bhb","bhc","bhd","bhe","bhf","bhg","bhh","bhi","bhj","bhk","bhl","bhm","bhn","bho","bhp","bhq","bhr","bhs","bht","bhu","bhv","bhw","bhx","bhy","bhz","bia","bib","bic","bid","bie","bif","big","bij","bik","bil","bim","bin","bio","bip","biq","bir","bit","biu","biv","biw","bix","biy","biz","bja","bjb","bjc","bjd","bje","bjf","bjg","bjh","bji","bjj","bjk","bjl","bjm","bjn","bjo","bjp","bjq","bjr","bjs","bjt","bju","bjv","bjw","bjx","bjy","bjz","bka","bkb","bkc","bkd","bkf","bkg","bkh","bki","bkj","bkk","bkl","bkm","bkn","bko","bkp","bkq","bkr","bks","bkt","bku","bkv","bkw","bkx","bky","bkz","bla","blb","blc","bld","ble","blf","blg","blh","bli","blj","blk","bll","blm","bln","blo","blp","blq","blr","bls","blt","blv","blw","blx","bly","blz","bma","bmb","bmc","bmd","bme","bmf","bmg","bmh","bmi","bmj","bmk","bml","bmm","bmn","bmo","bmp","bmq","bmr","bms","bmt","bmu","bmv","bmw","bmx","bmy","bmz","bna","bnb","bnc","bnd","bne","bnf","bng","bni","bnj","bnk","bnl","bnm","bnn","bno","bnp","bnq","bnr","bns","bnt","bnu","bnv","bnw","bnx","bny","bnz","boa","bob","boe","bof","bog","boh","boi","boj","bok","bol","bom","bon","boo","bop","boq","bor","bot","bou","bov","bow","box","boy","boz","bpa","bpb","bpd","bpg","bph","bpi","bpj","bpk","bpl","bpm","bpn","bpo","bpp","bpq","bpr","bps","bpt","bpu","bpv","bpw","bpx","bpy","bpz","bqa","bqb","bqc","bqd","bqf","bqg","bqh","bqi","bqj","bqk","bql","bqm","bqn","bqo","bqp","bqq","bqr","bqs","bqt","bqu","bqv","bqw","bqx","bqy","bqz","bra","brb","brc","brd","brf","brg","brh","bri","brj","brk","brl","brm","brn","bro","brp","brq","brr","brs","brt","bru","brv","brw","brx","bry","brz","bsa","bsb","bsc","bse","bsf","bsg","bsh","bsi","bsj","bsk","bsl","bsm","bsn","bso","bsp","bsq","bsr","bss","bst","bsu","bsv","bsw","bsx","bsy","bta","btb","btc","btd","bte","btf","btg","bth","bti","btj","btk","btl","btm","btn","bto","btp","btq","btr","bts","btt","btu","btv","btw","btx","bty","btz","bua","bub","buc","bud","bue","buf","bug","buh","bui","buj","buk","bum","bun","buo","bup","buq","bus","but","buu","buv","buw","bux","buy","buz","bva","bvb","bvc","bvd","bve","bvf","bvg","bvh","bvi","bvj","bvk","bvl","bvm","bvn","bvo","bvp","bvq","bvr","bvt","bvu","bvv","bvw","bvx","bvy","bvz","bwa","bwb","bwc","bwd","bwe","bwf","bwg","bwh","bwi","bwj","bwk","bwl","bwm","bwn","bwo","bwp","bwq","bwr","bws","bwt","bwu","bww","bwx","bwy","bwz","bxa","bxb","bxc","bxd","bxe","bxf","bxg","bxh","bxi","bxj","bxk","bxl","bxm","bxn","bxo","bxp","bxq","bxr","bxs","bxu","bxv","bxw","bxx","bxz","bya","byb","byc","byd","bye","byf","byg","byh","byi","byj","byk","byl","bym","byn","byo","byp","byq","byr","bys","byt","byv","byw","byx","byy","byz","bza","bzb","bzc","bzd","bze","bzf","bzg","bzh","bzi","bzj","bzk","bzl","bzm","bzn","bzo","bzp","bzq","bzr","bzs","bzt","bzu","bzv","bzw","bzx","bzy","bzz","caa","cab","cac","cad","cae","caf","cag","cah","cai","caj","cak","cal","cam","can","cao","cap","caq","car","cas","cau","cav","caw","cax","cay","caz","cba","cbb","cbc","cbd","cbe","cbg","cbh","cbi","cbj","cbk","cbl","cbn","cbo","cbq","cbr","cbs","cbt","cbu","cbv","cbw","cby","cca","ccc","ccd","cce","ccg","cch","ccj","ccl","ccm","ccn","cco","ccp","ccq","ccr","ccs","cda","cdc","cdd","cde","cdf","cdg","cdh","cdi","cdj","cdm","cdn","cdo","cdr","cds","cdy","cdz","cea","ceb","ceg","cek","cel","cen","cet","cfa","cfd","cfg","cfm","cga","cgc","cgg","cgk","chb","chc","chd","chf","chg","chh","chj","chk","chl","chm","chn","cho","chp","chq","chr","cht","chw","chx","chy","chz","cia","cib","cic","cid","cie","cih","cik","cim","cin","cip","cir","ciw","ciy","cja","cje","cjh","cji","cjk","cjm","cjn","cjo","cjp","cjr","cjs","cjv","cjy","cka","ckb","ckh","ckl","ckn","cko","ckq","ckr","cks","ckt","cku","ckv","ckx","cky","ckz","cla","clc","cld","cle","clh","cli","clj","clk","cll","clm","clo","clt","clu","clw","cly","cma","cmc","cme","cmg","cmi","cmk","cml","cmm","cmn","cmo","cmr","cms","cmt","cna","cnb","cnc","cng","cnh","cni","cnk","cnl","cno","cnr","cns","cnt","cnu","cnw","cnx","coa","cob","coc","cod","coe","cof","cog","coh","coj","cok","col","com","con","coo","cop","coq","cot","cou","cov","cow","cox","coy","coz","cpa","cpb","cpc","cpe","cpf","cpg","cpi","cpn","cpo","cpp","cps","cpu","cpx","cpy","cqd","cqu","cra","crb","crc","crd","crf","crg","crh","cri","crj","crk","crl","crm","crn","cro","crp","crq","crr","crs","crt","crv","crw","crx","cry","crz","csa","csb","csc","csd","cse","csf","csg","csh","csi","csj","csk","csl","csm","csn","cso","csq","csr","css","cst","csu","csv","csw","csy","csz","cta","ctc","ctd","cte","ctg","cth","ctl","ctm","ctn","cto","ctp","cts","ctt","ctu","ctz","cua","cub","cuc","cug","cuh","cui","cuj","cuk","cul","cum","cuo","cup","cuq","cur","cus","cut","cuu","cuv","cuw","cux","cuy","cvg","cvn","cwa","cwb","cwd","cwe","cwg","cwt","cya","cyb","cyo","czh","czk","czn","czo","czt","daa","dac","dad","dae","daf","dag","dah","dai","daj","dak","dal","dam","dao","dap","daq","dar","das","dau","dav","daw","dax","day","daz","dba","dbb","dbd","dbe","dbf","dbg","dbi","dbj","dbl","dbm","dbn","dbo","dbp","dbq","dbr","dbt","dbu","dbv","dbw","dby","dcc","dcr","dda","ddd","dde","ddg","ddi","ddj","ddn","ddo","ddr","dds","ddw","dec","ded","dee","def","deg","deh","dei","dek","del","dem","den","dep","deq","der","des","dev","dez","dga","dgb","dgc","dgd","dge","dgg","dgh","dgi","dgk","dgl","dgn","dgo","dgr","dgs","dgt","dgu","dgw","dgx","dgz","dha","dhd","dhg","dhi","dhl","dhm","dhn","dho","dhr","dhs","dhu","dhv","dhw","dhx","dia","dib","dic","did","dif","dig","dih","dii","dij","dik","dil","dim","din","dio","dip","diq","dir","dis","dit","diu","diw","dix","diy","diz","dja","djb","djc","djd","dje","djf","dji","djj","djk","djl","djm","djn","djo","djr","dju","djw","dka","dkk","dkl","dkr","dks","dkx","dlg","dlk","dlm","dln","dma","dmb","dmc","dmd","dme","dmg","dmk","dml","dmm","dmn","dmo","dmr","dms","dmu","dmv","dmw","dmx","dmy","dna","dnd","dne","dng","dni","dnj","dnk","dnn","dnr","dnt","dnu","dnv","dnw","dny","doa","dob","doc","doe","dof","doh","doi","dok","dol","don","doo","dop","doq","dor","dos","dot","dov","dow","dox","doy","doz","dpp","dra","drb","drc","drd","dre","drg","drh","dri","drl","drn","dro","drq","drr","drs","drt","dru","drw","dry","dsb","dse","dsh","dsi","dsl","dsn","dso","dsq","dta","dtb","dtd","dth","dti","dtk","dtm","dtn","dto","dtp","dtr","dts","dtt","dtu","dty","dua","dub","duc","dud","due","duf","dug","duh","dui","duj","duk","dul","dum","dun","duo","dup","duq","dur","dus","duu","duv","duw","dux","duy","duz","dva","dwa","dwl","dwr","dws","dwu","dww","dwy","dya","dyb","dyd","dyg","dyi","dym","dyn","dyo","dyu","dyy","dza","dzd","dze","dzg","dzl","dzn","eaa","ebg","ebk","ebo","ebr","ebu","ecr","ecs","ecy","eee","efa","efe","efi","ega","egl","ego","egx","egy","ehu","eip","eit","eiv","eja","eka","ekc","eke","ekg","eki","ekk","ekl","ekm","eko","ekp","ekr","eky","ele","elh","eli","elk","elm","elo","elp","elu","elx","ema","emb","eme","emg","emi","emk","emm","emn","emo","emp","ems","emu","emw","emx","emy","ena","enb","enc","end","enf","enh","enl","enm","enn","eno","enq","enr","enu","env","enw","enx","eot","epi","era","erg","erh","eri","erk","ero","err","ers","ert","erw","ese","esg","esh","esi","esk","esl","esm","esn","eso","esq","ess","esu","esx","esy","etb","etc","eth","etn","eto","etr","ets","ett","etu","etx","etz","euq","eve","evh","evn","ewo","ext","eya","eyo","eza","eze","faa","fab","fad","faf","fag","fah","fai","faj","fak","fal","fam","fan","fap","far","fat","fau","fax","fay","faz","fbl","fcs","fer","ffi","ffm","fgr","fia","fie","fil","fip","fir","fit","fiu","fiw","fkk","fkv","fla","flh","fli","fll","fln","flr","fly","fmp","fmu","fnb","fng","fni","fod","foi","fom","fon","for","fos","fox","fpe","fqs","frc","frd","frk","frm","fro","frp","frq","frr","frs","frt","fse","fsl","fss","fub","fuc","fud","fue","fuf","fuh","fui","fuj","fum","fun","fuq","fur","fut","fuu","fuv","fuy","fvr","fwa","fwe","gaa","gab","gac","gad","gae","gaf","gag","gah","gai","gaj","gak","gal","gam","gan","gao","gap","gaq","gar","gas","gat","gau","gav","gaw","gax","gay","gaz","gba","gbb","gbc","gbd","gbe","gbf","gbg","gbh","gbi","gbj","gbk","gbl","gbm","gbn","gbo","gbp","gbq","gbr","gbs","gbu","gbv","gbw","gbx","gby","gbz","gcc","gcd","gce","gcf","gcl","gcn","gcr","gct","gda","gdb","gdc","gdd","gde","gdf","gdg","gdh","gdi","gdj","gdk","gdl","gdm","gdn","gdo","gdq","gdr","gds","gdt","gdu","gdx","gea","geb","gec","ged","geg","geh","gei","gej","gek","gel","gem","geq","ges","gev","gew","gex","gey","gez","gfk","gft","gfx","gga","ggb","ggd","gge","ggg","ggk","ggl","ggn","ggo","ggr","ggt","ggu","ggw","gha","ghc","ghe","ghh","ghk","ghl","ghn","gho","ghr","ghs","ght","gia","gib","gic","gid","gie","gig","gih","gil","gim","gin","gio","gip","giq","gir","gis","git","giu","giw","gix","giy","giz","gji","gjk","gjm","gjn","gjr","gju","gka","gkd","gke","gkn","gko","gkp","gku","glc","gld","glh","gli","glj","glk","gll","glo","glr","glu","glw","gly","gma","gmb","gmd","gme","gmg","gmh","gml","gmm","gmn","gmq","gmu","gmv","gmw","gmx","gmy","gmz","gna","gnb","gnc","gnd","gne","gng","gnh","gni","gnj","gnk","gnl","gnm","gnn","gno","gnq","gnr","gnt","gnu","gnw","gnz","goa","gob","goc","god","goe","gof","gog","goh","goi","goj","gok","gol","gom","gon","goo","gop","goq","gor","gos","got","gou","gow","gox","goy","goz","gpa","gpe","gpn","gqa","gqi","gqn","gqr","gqu","gra","grb","grc","grd","grg","grh","gri","grj","grk","grm","gro","grq","grr","grs","grt","gru","grv","grw","grx","gry","grz","gse","gsg","gsl","gsm","gsn","gso","gsp","gss","gsw","gta","gti","gtu","gua","gub","guc","gud","gue","guf","gug","guh","gui","guk","gul","gum","gun","guo","gup","guq","gur","gus","gut","guu","guv","guw","gux","guz","gva","gvc","gve","gvf","gvj","gvl","gvm","gvn","gvo","gvp","gvr","gvs","gvy","gwa","gwb","gwc","gwd","gwe","gwf","gwg","gwi","gwj","gwm","gwn","gwr","gwt","gwu","gww","gwx","gxx","gya","gyb","gyd","gye","gyf","gyg","gyi","gyl","gym","gyn","gyo","gyr","gyy","gza","gzi","gzn","haa","hab","hac","had","hae","haf","hag","hah","hai","haj","hak","hal","ham","han","hao","hap","haq","har","has","hav","haw","hax","hay","haz","hba","hbb","hbn","hbo","hbu","hca","hch","hdn","hds","hdy","hea","hed","heg","heh","hei","hem","hgm","hgw","hhi","hhr","hhy","hia","hib","hid","hif","hig","hih","hii","hij","hik","hil","him","hio","hir","hit","hiw","hix","hji","hka","hke","hkk","hkn","hks","hla","hlb","hld","hle","hlt","hlu","hma","hmb","hmc","hmd","hme","hmf","hmg","hmh","hmi","hmj","hmk","hml","hmm","hmn","hmp","hmq","hmr","hms","hmt","hmu","hmv","hmw","hmx","hmy","hmz","hna","hnd","hne","hnh","hni","hnj","hnn","hno","hns","hnu","hoa","hob","hoc","hod","hoe","hoh","hoi","hoj","hok","hol","hom","hoo","hop","hor","hos","hot","hov","how","hoy","hoz","hpo","hps","hra","hrc","hre","hrk","hrm","hro","hrp","hrr","hrt","hru","hrw","hrx","hrz","hsb","hsh","hsl","hsn","hss","hti","hto","hts","htu","htx","hub","huc","hud","hue","huf","hug","huh","hui","huj","huk","hul","hum","huo","hup","huq","hur","hus","hut","huu","huv","huw","hux","huy","huz","hvc","hve","hvk","hvn","hvv","hwa","hwc","hwo","hya","hyw","hyx","iai","ian","iap","iar","iba","ibb","ibd","ibe","ibg","ibh","ibi","ibl","ibm","ibn","ibr","ibu","iby","ica","ich","icl","icr","ida","idb","idc","idd","ide","idi","idr","ids","idt","idu","ifa","ifb","ife","iff","ifk","ifm","ifu","ify","igb","ige","igg","igl","igm","ign","igo","igs","igw","ihb","ihi","ihp","ihw","iin","iir","ijc","ije","ijj","ijn","ijo","ijs","ike","iki","ikk","ikl","iko","ikp","ikr","iks","ikt","ikv","ikw","ikx","ikz","ila","ilb","ilg","ili","ilk","ill","ilm","ilo","ilp","ils","ilu","ilv","ilw","ima","ime","imi","iml","imn","imo","imr","ims","imy","inb","inc","ine","ing","inh","inj","inl","inm","inn","ino","inp","ins","int","inz","ior","iou","iow","ipi","ipo","iqu","iqw","ira","ire","irh","iri","irk","irn","iro","irr","iru","irx","iry","isa","isc","isd","ise","isg","ish","isi","isk","ism","isn","iso","isr","ist","isu","itb","itc","itd","ite","iti","itk","itl","itm","ito","itr","its","itt","itv","itw","itx","ity","itz","ium","ivb","ivv","iwk","iwm","iwo","iws","ixc","ixl","iya","iyo","iyx","izh","izi","izr","izz","jaa","jab","jac","jad","jae","jaf","jah","jaj","jak","jal","jam","jan","jao","jaq","jar","jas","jat","jau","jax","jay","jaz","jbe","jbi","jbj","jbk","jbn","jbo","jbr","jbt","jbu","jbw","jcs","jct","jda","jdg","jdt","jeb","jee","jeg","jeh","jei","jek","jel","jen","jer","jet","jeu","jgb","jge","jgk","jgo","jhi","jhs","jia","jib","jic","jid","jie","jig","jih","jii","jil","jim","jio","jiq","jit","jiu","jiv","jiy","jje","jjr","jka","jkm","jko","jkp","jkr","jku","jle","jls","jma","jmb","jmc","jmd","jmi","jml","jmn","jmr","jms","jmw","jmx","jna","jnd","jng","jni","jnj","jnl","jns","job","jod","jog","jor","jos","jow","jpa","jpr","jpx","jqr","jra","jrb","jrr","jrt","jru","jsl","jua","jub","juc","jud","juh","jui","juk","jul","jum","jun","juo","jup","jur","jus","jut","juu","juw","juy","jvd","jvn","jwi","jya","jye","jyy","kaa","kab","kac","kad","kae","kaf","kag","kah","kai","kaj","kak","kam","kao","kap","kaq","kar","kav","kaw","kax","kay","kba","kbb","kbc","kbd","kbe","kbf","kbg","kbh","kbi","kbj","kbk","kbl","kbm","kbn","kbo","kbp","kbq","kbr","kbs","kbt","kbu","kbv","kbw","kbx","kby","kbz","kca","kcb","kcc","kcd","kce","kcf","kcg","kch","kci","kcj","kck","kcl","kcm","kcn","kco","kcp","kcq","kcr","kcs","kct","kcu","kcv","kcw","kcx","kcy","kcz","kda","kdc","kdd","kde","kdf","kdg","kdh","kdi","kdj","kdk","kdl","kdm","kdn","kdo","kdp","kdq","kdr","kdt","kdu","kdv","kdw","kdx","kdy","kdz","kea","keb","kec","ked","kee","kef","keg","keh","kei","kej","kek","kel","kem","ken","keo","kep","keq","ker","kes","ket","keu","kev","kew","kex","key","kez","kfa","kfb","kfc","kfd","kfe","kff","kfg","kfh","kfi","kfj","kfk","kfl","kfm","kfn","kfo","kfp","kfq","kfr","kfs","kft","kfu","kfv","kfw","kfx","kfy","kfz","kga","kgb","kgc","kgd","kge","kgf","kgg","kgh","kgi","kgj","kgk","kgl","kgm","kgn","kgo","kgp","kgq","kgr","kgs","kgt","kgu","kgv","kgw","kgx","kgy","kha","khb","khc","khd","khe","khf","khg","khh","khi","khj","khk","khl","khn","kho","khp","khq","khr","khs","kht","khu","khv","khw","khx","khy","khz","kia","kib","kic","kid","kie","kif","kig","kih","kii","kij","kil","kim","kio","kip","kiq","kis","kit","kiu","kiv","kiw","kix","kiy","kiz","kja","kjb","kjc","kjd","kje","kjf","kjg","kjh","kji","kjj","kjk","kjl","kjm","kjn","kjo","kjp","kjq","kjr","kjs","kjt","kju","kjv","kjx","kjy","kjz","kka","kkb","kkc","kkd","kke","kkf","kkg","kkh","kki","kkj","kkk","kkl","kkm","kkn","kko","kkp","kkq","kkr","kks","kkt","kku","kkv","kkw","kkx","kky","kkz","kla","klb","klc","kld","kle","klf","klg","klh","kli","klj","klk","kll","klm","kln","klo","klp","klq","klr","kls","klt","klu","klv","klw","klx","kly","klz","kma","kmb","kmc","kmd","kme","kmf","kmg","kmh","kmi","kmj","kmk","kml","kmm","kmn","kmo","kmp","kmq","kmr","kms","kmt","kmu","kmv","kmw","kmx","kmy","kmz","kna","knb","knc","knd","kne","knf","kng","kni","knj","knk","knl","knm","knn","kno","knp","knq","knr","kns","knt","knu","knv","knw","knx","kny","knz","koa","koc","kod","koe","kof","kog","koh","koi","koj","kok","kol","koo","kop","koq","kos","kot","kou","kov","kow","kox","koy","koz","kpa","kpb","kpc","kpd","kpe","kpf","kpg","kph","kpi","kpj","kpk","kpl","kpm","kpn","kpo","kpp","kpq","kpr","kps","kpt","kpu","kpv","kpw","kpx","kpy","kpz","kqa","kqb","kqc","kqd","kqe","kqf","kqg","kqh","kqi","kqj","kqk","kql","kqm","kqn","kqo","kqp","kqq","kqr","kqs","kqt","kqu","kqv","kqw","kqx","kqy","kqz","kra","krb","krc","krd","kre","krf","krh","kri","krj","krk","krl","krm","krn","kro","krp","krr","krs","krt","kru","krv","krw","krx","kry","krz","ksa","ksb","ksc","ksd","kse","ksf","ksg","ksh","ksi","ksj","ksk","ksl","ksm","ksn","kso","ksp","ksq","ksr","kss","kst","ksu","ksv","ksw","ksx","ksy","ksz","kta","ktb","ktc","ktd","kte","ktf","ktg","kth","kti","ktj","ktk","ktl","ktm","ktn","kto","ktp","ktq","ktr","kts","ktt","ktu","ktv","ktw","ktx","kty","ktz","kub","kuc","kud","kue","kuf","kug","kuh","kui","kuj","kuk","kul","kum","kun","kuo","kup","kuq","kus","kut","kuu","kuv","kuw","kux","kuy","kuz","kva","kvb","kvc","kvd","kve","kvf","kvg","kvh","kvi","kvj","kvk","kvl","kvm","kvn","kvo","kvp","kvq","kvr","kvs","kvt","kvu","kvv","kvw","kvx","kvy","kvz","kwa","kwb","kwc","kwd","kwe","kwf","kwg","kwh","kwi","kwj","kwk","kwl","kwm","kwn","kwo","kwp","kwq","kwr","kws","kwt","kwu","kwv","kww","kwx","kwy","kwz","kxa","kxb","kxc","kxd","kxe","kxf","kxh","kxi","kxj","kxk","kxl","kxm","kxn","kxo","kxp","kxq","kxr","kxs","kxt","kxu","kxv","kxw","kxx","kxy","kxz","kya","kyb","kyc","kyd","kye","kyf","kyg","kyh","kyi","kyj","kyk","kyl","kym","kyn","kyo","kyp","kyq","kyr","kys","kyt","kyu","kyv","kyw","kyx","kyy","kyz","kza","kzb","kzc","kzd","kze","kzf","kzg","kzh","kzi","kzj","kzk","kzl","kzm","kzn","kzo","kzp","kzq","kzr","kzs","kzt","kzu","kzv","kzw","kzx","kzy","kzz","laa","lab","lac","lad","lae","laf","lag","lah","lai","laj","lak","lal","lam","lan","lap","laq","lar","las","lau","law","lax","lay","laz","lba","lbb","lbc","lbe","lbf","lbg","lbi","lbj","lbk","lbl","lbm","lbn","lbo","lbq","lbr","lbs","lbt","lbu","lbv","lbw","lbx","lby","lbz","lcc","lcd","lce","lcf","lch","lcl","lcm","lcp","lcq","lcs","lda","ldb","ldd","ldg","ldh","ldi","ldj","ldk","ldl","ldm","ldn","ldo","ldp","ldq","lea","leb","lec","led","lee","lef","leg","leh","lei","lej","lek","lel","lem","len","leo","lep","leq","ler","les","let","leu","lev","lew","lex","ley","lez","lfa","lfn","lga","lgb","lgg","lgh","lgi","lgk","lgl","lgm","lgn","lgq","lgr","lgt","lgu","lgz","lha","lhh","lhi","lhl","lhm","lhn","lhp","lhs","lht","lhu","lia","lib","lic","lid","lie","lif","lig","lih","lii","lij","lik","lil","lio","lip","liq","lir","lis","liu","liv","liw","lix","liy","liz","lja","lje","lji","ljl","ljp","ljw","ljx","lka","lkb","lkc","lkd","lke","lkh","lki","lkj","lkl","lkm","lkn","lko","lkr","lks","lkt","lku","lky","lla","llb","llc","lld","lle","llf","llg","llh","lli","llj","llk","lll","llm","lln","llo","llp","llq","lls","llu","llx","lma","lmb","lmc","lmd","lme","lmf","lmg","lmh","lmi","lmj","lmk","lml","lmm","lmn","lmo","lmp","lmq","lmr","lmu","lmv","lmw","lmx","lmy","lmz","lna","lnb","lnd","lng","lnh","lni","lnj","lnl","lnm","lnn","lno","lns","lnu","lnw","lnz","loa","lob","loc","loe","lof","log","loh","loi","loj","lok","lol","lom","lon","loo","lop","loq","lor","los","lot","lou","lov","low","lox","loy","loz","lpa","lpe","lpn","lpo","lpx","lra","lrc","lre","lrg","lri","lrk","lrl","lrm","lrn","lro","lrr","lrt","lrv","lrz","lsa","lsd","lse","lsg","lsh","lsi","lsl","lsm","lso","lsp","lsr","lss","lst","lsy","ltc","ltg","lth","lti","ltn","lto","lts","ltu","lua","luc","lud","lue","luf","lui","luj","luk","lul","lum","lun","luo","lup","luq","lur","lus","lut","luu","luv","luw","luy","luz","lva","lvk","lvs","lvu","lwa","lwe","lwg","lwh","lwl","lwm","lwo","lws","lwt","lwu","lww","lya","lyg","lyn","lzh","lzl","lzn","lzz","maa","mab","mad","mae","maf","mag","mai","maj","mak","mam","man","map","maq","mas","mat","mau","mav","maw","max","maz","mba","mbb","mbc","mbd","mbe","mbf","mbh","mbi","mbj","mbk","mbl","mbm","mbn","mbo","mbp","mbq","mbr","mbs","mbt","mbu","mbv","mbw","mbx","mby","mbz","mca","mcb","mcc","mcd","mce","mcf","mcg","mch","mci","mcj","mck","mcl","mcm","mcn","mco","mcp","mcq","mcr","mcs","mct","mcu","mcv","mcw","mcx","mcy","mcz","mda","mdb","mdc","mdd","mde","mdf","mdg","mdh","mdi","mdj","mdk","mdl","mdm","mdn","mdp","mdq","mdr","mds","mdt","mdu","mdv","mdw","mdx","mdy","mdz","mea","meb","mec","med","mee","mef","meg","meh","mei","mej","mek","mel","mem","men","meo","mep","meq","mer","mes","met","meu","mev","mew","mey","mez","mfa","mfb","mfc","mfd","mfe","mff","mfg","mfh","mfi","mfj","mfk","mfl","mfm","mfn","mfo","mfp","mfq","mfr","mfs","mft","mfu","mfv","mfw","mfx","mfy","mfz","mga","mgb","mgc","mgd","mge","mgf","mgg","mgh","mgi","mgj","mgk","mgl","mgm","mgn","mgo","mgp","mgq","mgr","mgs","mgt","mgu","mgv","mgw","mgx","mgy","mgz","mha","mhb","mhc","mhd","mhe","mhf","mhg","mhh","mhi","mhj","mhk","mhl","mhm","mhn","mho","mhp","mhq","mhr","mhs","mht","mhu","mhw","mhx","mhy","mhz","mia","mib","mic","mid","mie","mif","mig","mih","mii","mij","mik","mil","mim","min","mio","mip","miq","mir","mis","mit","miu","miw","mix","miy","miz","mja","mjb","mjc","mjd","mje","mjg","mjh","mji","mjj","mjk","mjl","mjm","mjn","mjo","mjp","mjq","mjr","mjs","mjt","mju","mjv","mjw","mjx","mjy","mjz","mka","mkb","mkc","mke","mkf","mkg","mkh","mki","mkj","mkk","mkl","mkm","mkn","mko","mkp","mkq","mkr","mks","mkt","mku","mkv","mkw","mkx","mky","mkz","mla","mlb","mlc","mld","mle","mlf","mlh","mli","mlj","mlk","mll","mlm","mln","mlo","mlp","mlq","mlr","mls","mlu","mlv","mlw","mlx","mlz","mma","mmb","mmc","mmd","mme","mmf","mmg","mmh","mmi","mmj","mmk","mml","mmm","mmn","mmo","mmp","mmq","mmr","mmt","mmu","mmv","mmw","mmx","mmy","mmz","mna","mnb","mnc","mnd","mne","mnf","mng","mnh","mni","mnj","mnk","mnl","mnm","mnn","mno","mnp","mnq","mnr","mns","mnt","mnu","mnv","mnw","mnx","mny","mnz","moa","moc","mod","moe","mof","mog","moh","moi","moj","mok","mom","moo","mop","moq","mor","mos","mot","mou","mov","mow","mox","moy","moz","mpa","mpb","mpc","mpd","mpe","mpg","mph","mpi","mpj","mpk","mpl","mpm","mpn","mpo","mpp","mpq","mpr","mps","mpt","mpu","mpv","mpw","mpx","mpy","mpz","mqa","mqb","mqc","mqe","mqf","mqg","mqh","mqi","mqj","mqk","mql","mqm","mqn","mqo","mqp","mqq","mqr","mqs","mqt","mqu","mqv","mqw","mqx","mqy","mqz","mra","mrb","mrc","mrd","mre","mrf","mrg","mrh","mrj","mrk","mrl","mrm","mrn","mro","mrp","mrq","mrr","mrs","mrt","mru","mrv","mrw","mrx","mry","mrz","msb","msc","msd","mse","msf","msg","msh","msi","msj","msk","msl","msm","msn","mso","msp","msq","msr","mss","mst","msu","msv","msw","msx","msy","msz","mta","mtb","mtc","mtd","mte","mtf","mtg","mth","mti","mtj","mtk","mtl","mtm","mtn","mto","mtp","mtq","mtr","mts","mtt","mtu","mtv","mtw","mtx","mty","mua","mub","muc","mud","mue","mug","muh","mui","muj","muk","mul","mum","mun","muo","mup","muq","mur","mus","mut","muu","muv","mux","muy","muz","mva","mvb","mvd","mve","mvf","mvg","mvh","mvi","mvk","mvl","mvm","mvn","mvo","mvp","mvq","mvr","mvs","mvt","mvu","mvv","mvw","mvx","mvy","mvz","mwa","mwb","mwc","mwd","mwe","mwf","mwg","mwh","mwi","mwj","mwk","mwl","mwm","mwn","mwo","mwp","mwq","mwr","mws","mwt","mwu","mwv","mww","mwx","mwy","mwz","mxa","mxb","mxc","mxd","mxe","mxf","mxg","mxh","mxi","mxj","mxk","mxl","mxm","mxn","mxo","mxp","mxq","mxr","mxs","mxt","mxu","mxv","mxw","mxx","mxy","mxz","myb","myc","myd","mye","myf","myg","myh","myi","myj","myk","myl","mym","myn","myo","myp","myq","myr","mys","myt","myu","myv","myw","myx","myy","myz","mza","mzb","mzc","mzd","mze","mzg","mzh","mzi","mzj","mzk","mzl","mzm","mzn","mzo","mzp","mzq","mzr","mzs","mzt","mzu","mzv","mzw","mzx","mzy","mzz","naa","nab","nac","nad","nae","naf","nag","nah","nai","naj","nak","nal","nam","nan","nao","nap","naq","nar","nas","nat","naw","nax","nay","naz","nba","nbb","nbc","nbd","nbe","nbf","nbg","nbh","nbi","nbj","nbk","nbm","nbn","nbo","nbp","nbq","nbr","nbs","nbt","nbu","nbv","nbw","nbx","nby","nca","ncb","ncc","ncd","nce","ncf","ncg","nch","nci","ncj","nck","ncl","ncm","ncn","nco","ncp","ncq","ncr","ncs","nct","ncu","ncx","ncz","nda","ndb","ndc","ndd","ndf","ndg","ndh","ndi","ndj","ndk","ndl","ndm","ndn","ndp","ndq","ndr","nds","ndt","ndu","ndv","ndw","ndx","ndy","ndz","nea","neb","nec","ned","nee","nef","neg","neh","nei","nej","nek","nem","nen","neo","neq","ner","nes","net","neu","nev","new","nex","ney","nez","nfa","nfd","nfl","nfr","nfu","nga","ngb","ngc","ngd","nge","ngf","ngg","ngh","ngi","ngj","ngk","ngl","ngm","ngn","ngo","ngp","ngq","ngr","ngs","ngt","ngu","ngv","ngw","ngx","ngy","ngz","nha","nhb","nhc","nhd","nhe","nhf","nhg","nhh","nhi","nhk","nhm","nhn","nho","nhp","nhq","nhr","nht","nhu","nhv","nhw","nhx","nhy","nhz","nia","nib","nic","nid","nie","nif","nig","nih","nii","nij","nik","nil","nim","nin","nio","niq","nir","nis","nit","niu","niv","niw","nix","niy","niz","nja","njb","njd","njh","nji","njj","njl","njm","njn","njo","njr","njs","njt","nju","njx","njy","njz","nka","nkb","nkc","nkd","nke","nkf","nkg","nkh","nki","nkj","nkk","nkm","nkn","nko","nkp","nkq","nkr","nks","nkt","nku","nkv","nkw","nkx","nkz","nla","nlc","nle","nlg","nli","nlj","nlk","nll","nlm","nln","nlo","nlq","nlr","nlu","nlv","nlw","nlx","nly","nlz","nma","nmb","nmc","nmd","nme","nmf","nmg","nmh","nmi","nmj","nmk","nml","nmm","nmn","nmo","nmp","nmq","nmr","nms","nmt","nmu","nmv","nmw","nmx","nmy","nmz","nna","nnb","nnc","nnd","nne","nnf","nng","nnh","nni","nnj","nnk","nnl","nnm","nnn","nnp","nnq","nnr","nns","nnt","nnu","nnv","nnw","nnx","nny","nnz","noa","noc","nod","noe","nof","nog","noh","noi","noj","nok","nol","nom","non","noo","nop","noq","nos","not","nou","nov","now","noy","noz","npa","npb","npg","nph","npi","npl","npn","npo","nps","npu","npx","npy","nqg","nqk","nql","nqm","nqn","nqo","nqq","nqy","nra","nrb","nrc","nre","nrf","nrg","nri","nrk","nrl","nrm","nrn","nrp","nrr","nrt","nru","nrx","nrz","nsa","nsc","nsd","nse","nsf","nsg","nsh","nsi","nsk","nsl","nsm","nsn","nso","nsp","nsq","nsr","nss","nst","nsu","nsv","nsw","nsx","nsy","nsz","ntd","nte","ntg","nti","ntj","ntk","ntm","nto","ntp","ntr","nts","ntu","ntw","ntx","nty","ntz","nua","nub","nuc","nud","nue","nuf","nug","nuh","nui","nuj","nuk","nul","num","nun","nuo","nup","nuq","nur","nus","nut","nuu","nuv","nuw","nux","nuy","nuz","nvh","nvm","nvo","nwa","nwb","nwc","nwe","nwg","nwi","nwm","nwo","nwr","nwx","nwy","nxa","nxd","nxe","nxg","nxi","nxk","nxl","nxm","nxn","nxo","nxq","nxr","nxu","nxx","nyb","nyc","nyd","nye","nyf","nyg","nyh","nyi","nyj","nyk","nyl","nym","nyn","nyo","nyp","nyq","nyr","nys","nyt","nyu","nyv","nyw","nyx","nyy","nza","nzb","nzd","nzi","nzk","nzm","nzs","nzu","nzy","nzz","oaa","oac","oar","oav","obi","obk","obl","obm","obo","obr","obt","obu","oca","och","oco","ocu","oda","odk","odt","odu","ofo","ofs","ofu","ogb","ogc","oge","ogg","ogo","ogu","oht","ohu","oia","oin","ojb","ojc","ojg","ojp","ojs","ojv","ojw","oka","okb","okd","oke","okg","okh","oki","okj","okk","okl","okm","okn","oko","okr","oks","oku","okv","okx","ola","old","ole","olk","olm","olo","olr","olt","olu","oma","omb","omc","ome","omg","omi","omk","oml","omn","omo","omp","omq","omr","omt","omu","omv","omw","omx","ona","onb","one","ong","oni","onj","onk","onn","ono","onp","onr","ons","ont","onu","onw","onx","ood","oog","oon","oor","oos","opa","opk","opm","opo","opt","opy","ora","orc","ore","org","orh","orn","oro","orr","ors","ort","oru","orv","orw","orx","ory","orz","osa","osc","osi","oso","osp","ost","osu","osx","ota","otb","otd","ote","oti","otk","otl","otm","otn","oto","otq","otr","ots","ott","otu","otw","otx","oty","otz","oua","oub","oue","oui","oum","oun","ovd","owi","owl","oyb","oyd","oym","oyy","ozm","paa","pab","pac","pad","pae","paf","pag","pah","pai","pak","pal","pam","pao","pap","paq","par","pas","pat","pau","pav","paw","pax","pay","paz","pbb","pbc","pbe","pbf","pbg","pbh","pbi","pbl","pbm","pbn","pbo","pbp","pbr","pbs","pbt","pbu","pbv","pby","pbz","pca","pcb","pcc","pcd","pce","pcf","pcg","pch","pci","pcj","pck","pcl","pcm","pcn","pcp","pcr","pcw","pda","pdc","pdi","pdn","pdo","pdt","pdu","pea","peb","ped","pee","pef","peg","peh","pei","pej","pek","pel","pem","peo","pep","peq","pes","pev","pex","pey","pez","pfa","pfe","pfl","pga","pgd","pgg","pgi","pgk","pgl","pgn","pgs","pgu","pgy","pgz","pha","phd","phg","phh","phi","phk","phl","phm","phn","pho","phq","phr","pht","phu","phv","phw","pia","pib","pic","pid","pie","pif","pig","pih","pii","pij","pil","pim","pin","pio","pip","pir","pis","pit","piu","piv","piw","pix","piy","piz","pjt","pka","pkb","pkc","pkg","pkh","pkn","pko","pkp","pkr","pks","pkt","pku","pla","plb","plc","pld","ple","plf","plg","plh","plj","plk","pll","pln","plo","plp","plq","plr","pls","plt","plu","plv","plw","ply","plz","pma","pmb","pmc","pmd","pme","pmf","pmh","pmi","pmj","pmk","pml","pmm","pmn","pmo","pmq","pmr","pms","pmt","pmu","pmw","pmx","pmy","pmz","pna","pnb","pnc","pne","png","pnh","pni","pnj","pnk","pnl","pnm","pnn","pno","pnp","pnq","pnr","pns","pnt","pnu","pnv","pnw","pnx","pny","pnz","poc","pod","poe","pof","pog","poh","poi","pok","pom","pon","poo","pop","poq","pos","pot","pov","pow","pox","poy","poz","ppa","ppe","ppi","ppk","ppl","ppm","ppn","ppo","ppp","ppq","ppr","pps","ppt","ppu","pqa","pqe","pqm","pqw","pra","prb","prc","prd","pre","prf","prg","prh","pri","prk","prl","prm","prn","pro","prp","prq","prr","prs","prt","pru","prw","prx","pry","prz","psa","psc","psd","pse","psg","psh","psi","psl","psm","psn","pso","psp","psq","psr","pss","pst","psu","psw","psy","pta","pth","pti","ptn","pto","ptp","ptq","ptr","ptt","ptu","ptv","ptw","pty","pua","pub","puc","pud","pue","puf","pug","pui","puj","puk","pum","puo","pup","puq","pur","put","puu","puw","pux","puy","puz","pwa","pwb","pwg","pwi","pwm","pwn","pwo","pwr","pww","pxm","pye","pym","pyn","pys","pyu","pyx","pyy","pzn","qaa..qtz","qua","qub","quc","qud","quf","qug","quh","qui","quk","qul","qum","qun","qup","quq","qur","qus","quv","quw","qux","quy","quz","qva","qvc","qve","qvh","qvi","qvj","qvl","qvm","qvn","qvo","qvp","qvs","qvw","qvy","qvz","qwa","qwc","qwe","qwh","qwm","qws","qwt","qxa","qxc","qxh","qxl","qxn","qxo","qxp","qxq","qxr","qxs","qxt","qxu","qxw","qya","qyp","raa","rab","rac","rad","raf","rag","rah","rai","raj","rak","ral","ram","ran","rao","rap","raq","rar","ras","rat","rau","rav","raw","rax","ray","raz","rbb","rbk","rbl","rbp","rcf","rdb","rea","reb","ree","reg","rei","rej","rel","rem","ren","rer","res","ret","rey","rga","rge","rgk","rgn","rgr","rgs","rgu","rhg","rhp","ria","rie","rif","ril","rim","rin","rir","rit","riu","rjg","rji","rjs","rka","rkb","rkh","rki","rkm","rkt","rkw","rma","rmb","rmc","rmd","rme","rmf","rmg","rmh","rmi","rmk","rml","rmm","rmn","rmo","rmp","rmq","rmr","rms","rmt","rmu","rmv","rmw","rmx","rmy","rmz","rna","rnd","rng","rnl","rnn","rnp","rnr","rnw","roa","rob","roc","rod","roe","rof","rog","rol","rom","roo","rop","ror","rou","row","rpn","rpt","rri","rro","rrt","rsb","rsi","rsl","rsm","rtc","rth","rtm","rts","rtw","rub","ruc","rue","ruf","rug","ruh","rui","ruk","ruo","rup","ruq","rut","ruu","ruy","ruz","rwa","rwk","rwm","rwo","rwr","rxd","rxw","ryn","rys","ryu","rzh","saa","sab","sac","sad","sae","saf","sah","sai","saj","sak","sal","sam","sao","sap","saq","sar","sas","sat","sau","sav","saw","sax","say","saz","sba","sbb","sbc","sbd","sbe","sbf","sbg","sbh","sbi","sbj","sbk","sbl","sbm","sbn","sbo","sbp","sbq","sbr","sbs","sbt","sbu","sbv","sbw","sbx","sby","sbz","sca","scb","sce","scf","scg","sch","sci","sck","scl","scn","sco","scp","scq","scs","sct","scu","scv","scw","scx","sda","sdb","sdc","sde","sdf","sdg","sdh","sdj","sdk","sdl","sdm","sdn","sdo","sdp","sdr","sds","sdt","sdu","sdv","sdx","sdz","sea","seb","sec","sed","see","sef","seg","seh","sei","sej","sek","sel","sem","sen","seo","sep","seq","ser","ses","set","seu","sev","sew","sey","sez","sfb","sfe","sfm","sfs","sfw","sga","sgb","sgc","sgd","sge","sgg","sgh","sgi","sgj","sgk","sgl","sgm","sgn","sgo","sgp","sgr","sgs","sgt","sgu","sgw","sgx","sgy","sgz","sha","shb","shc","shd","she","shg","shh","shi","shj","shk","shl","shm","shn","sho","shp","shq","shr","shs","sht","shu","shv","shw","shx","shy","shz","sia","sib","sid","sie","sif","sig","sih","sii","sij","sik","sil","sim","sio","sip","siq","sir","sis","sit","siu","siv","siw","six","siy","siz","sja","sjb","sjd","sje","sjg","sjk","sjl","sjm","sjn","sjo","sjp","sjr","sjs","sjt","sju","sjw","ska","skb","skc","skd","ske","skf","skg","skh","ski","skj","skk","skm","skn","sko","skp","skq","skr","sks","skt","sku","skv","skw","skx","sky","skz","sla","slc","sld","sle","slf","slg","slh","sli","slj","sll","slm","sln","slp","slq","slr","sls","slt","slu","slw","slx","sly","slz","sma","smb","smc","smd","smf","smg","smh","smi","smj","smk","sml","smm","smn","smp","smq","smr","sms","smt","smu","smv","smw","smx","smy","smz","snb","snc","sne","snf","sng","snh","sni","snj","snk","snl","snm","snn","sno","snp","snq","snr","sns","snu","snv","snw","snx","sny","snz","soa","sob","soc","sod","soe","sog","soh","soi","soj","sok","sol","son","soo","sop","soq","sor","sos","sou","sov","sow","sox","soy","soz","spb","spc","spd","spe","spg","spi","spk","spl","spm","spn","spo","spp","spq","spr","sps","spt","spu","spv","spx","spy","sqa","sqh","sqj","sqk","sqm","sqn","sqo","sqq","sqr","sqs","sqt","squ","sra","srb","src","sre","srf","srg","srh","sri","srk","srl","srm","srn","sro","srq","srr","srs","srt","sru","srv","srw","srx","sry","srz","ssa","ssb","ssc","ssd","sse","ssf","ssg","ssh","ssi","ssj","ssk","ssl","ssm","ssn","sso","ssp","ssq","ssr","sss","sst","ssu","ssv","ssx","ssy","ssz","sta","stb","std","ste","stf","stg","sth","sti","stj","stk","stl","stm","stn","sto","stp","stq","str","sts","stt","stu","stv","stw","sty","sua","sub","suc","sue","sug","sui","suj","suk","sul","sum","suq","sur","sus","sut","suv","suw","sux","suy","suz","sva","svb","svc","sve","svk","svm","svr","svs","svx","swb","swc","swf","swg","swh","swi","swj","swk","swl","swm","swn","swo","swp","swq","swr","sws","swt","swu","swv","sww","swx","swy","sxb","sxc","sxe","sxg","sxk","sxl","sxm","sxn","sxo","sxr","sxs","sxu","sxw","sya","syb","syc","syd","syi","syk","syl","sym","syn","syo","syr","sys","syw","syx","syy","sza","szb","szc","szd","sze","szg","szl","szn","szp","szs","szv","szw","taa","tab","tac","tad","tae","taf","tag","tai","taj","tak","tal","tan","tao","tap","taq","tar","tas","tau","tav","taw","tax","tay","taz","tba","tbb","tbc","tbd","tbe","tbf","tbg","tbh","tbi","tbj","tbk","tbl","tbm","tbn","tbo","tbp","tbq","tbr","tbs","tbt","tbu","tbv","tbw","tbx","tby","tbz","tca","tcb","tcc","tcd","tce","tcf","tcg","tch","tci","tck","tcl","tcm","tcn","tco","tcp","tcq","tcs","tct","tcu","tcw","tcx","tcy","tcz","tda","tdb","tdc","tdd","tde","tdf","tdg","tdh","tdi","tdj","tdk","tdl","tdm","tdn","tdo","tdq","tdr","tds","tdt","tdu","tdv","tdx","tdy","tea","teb","tec","ted","tee","tef","teg","teh","tei","tek","tem","ten","teo","tep","teq","ter","tes","tet","teu","tev","tew","tex","tey","tez","tfi","tfn","tfo","tfr","tft","tga","tgb","tgc","tgd","tge","tgf","tgg","tgh","tgi","tgj","tgn","tgo","tgp","tgq","tgr","tgs","tgt","tgu","tgv","tgw","tgx","tgy","tgz","thc","thd","the","thf","thh","thi","thk","thl","thm","thn","thp","thq","thr","ths","tht","thu","thv","thw","thx","thy","thz","tia","tic","tid","tie","tif","tig","tih","tii","tij","tik","til","tim","tin","tio","tip","tiq","tis","tit","tiu","tiv","tiw","tix","tiy","tiz","tja","tjg","tji","tjl","tjm","tjn","tjo","tjs","tju","tjw","tka","tkb","tkd","tke","tkf","tkg","tkk","tkl","tkm","tkn","tkp","tkq","tkr","tks","tkt","tku","tkv","tkw","tkx","tkz","tla","tlb","tlc","tld","tlf","tlg","tlh","tli","tlj","tlk","tll","tlm","tln","tlo","tlp","tlq","tlr","tls","tlt","tlu","tlv","tlw","tlx","tly","tma","tmb","tmc","tmd","tme","tmf","tmg","tmh","tmi","tmj","tmk","tml","tmm","tmn","tmo","tmp","tmq","tmr","tms","tmt","tmu","tmv","tmw","tmy","tmz","tna","tnb","tnc","tnd","tne","tnf","tng","tnh","tni","tnk","tnl","tnm","tnn","tno","tnp","tnq","tnr","tns","tnt","tnu","tnv","tnw","tnx","tny","tnz","tob","toc","tod","toe","tof","tog","toh","toi","toj","tol","tom","too","top","toq","tor","tos","tou","tov","tow","tox","toy","toz","tpa","tpc","tpe","tpf","tpg","tpi","tpj","tpk","tpl","tpm","tpn","tpo","tpp","tpq","tpr","tpt","tpu","tpv","tpw","tpx","tpy","tpz","tqb","tql","tqm","tqn","tqo","tqp","tqq","tqr","tqt","tqu","tqw","tra","trb","trc","trd","tre","trf","trg","trh","tri","trj","trk","trl","trm","trn","tro","trp","trq","trr","trs","trt","tru","trv","trw","trx","try","trz","tsa","tsb","tsc","tsd","tse","tsf","tsg","tsh","tsi","tsj","tsk","tsl","tsm","tsp","tsq","tsr","tss","tst","tsu","tsv","tsw","tsx","tsy","tsz","tta","ttb","ttc","ttd","tte","ttf","ttg","tth","tti","ttj","ttk","ttl","ttm","ttn","tto","ttp","ttq","ttr","tts","ttt","ttu","ttv","ttw","tty","ttz","tua","tub","tuc","tud","tue","tuf","tug","tuh","tui","tuj","tul","tum","tun","tuo","tup","tuq","tus","tut","tuu","tuv","tuw","tux","tuy","tuz","tva","tvd","tve","tvk","tvl","tvm","tvn","tvo","tvs","tvt","tvu","tvw","tvy","twa","twb","twc","twd","twe","twf","twg","twh","twl","twm","twn","two","twp","twq","twr","twt","twu","tww","twx","twy","txa","txb","txc","txe","txg","txh","txi","txj","txm","txn","txo","txq","txr","txs","txt","txu","txx","txy","tya","tye","tyh","tyi","tyj","tyl","tyn","typ","tyr","tys","tyt","tyu","tyv","tyx","tyz","tza","tzh","tzj","tzl","tzm","tzn","tzo","tzx","uam","uan","uar","uba","ubi","ubl","ubr","ubu","uby","uda","ude","udg","udi","udj","udl","udm","udu","ues","ufi","uga","ugb","uge","ugn","ugo","ugy","uha","uhn","uis","uiv","uji","uka","ukg","ukh","ukk","ukl","ukp","ukq","uks","uku","ukw","uky","ula","ulb","ulc","ule","ulf","uli","ulk","ull","ulm","uln","ulu","ulw","uma","umb","umc","umd","umg","umi","umm","umn","umo","ump","umr","ums","umu","una","und","une","ung","unk","unm","unn","unp","unr","unu","unx","unz","uok","upi","upv","ura","urb","urc","ure","urf","urg","urh","uri","urj","urk","url","urm","urn","uro","urp","urr","urt","uru","urv","urw","urx","ury","urz","usa","ush","usi","usk","usp","usu","uta","ute","utp","utr","utu","uum","uun","uur","uuu","uve","uvh","uvl","uwa","uya","uzn","uzs","vaa","vae","vaf","vag","vah","vai","vaj","val","vam","van","vao","vap","var","vas","vau","vav","vay","vbb","vbk","vec","ved","vel","vem","veo","vep","ver","vgr","vgt","vic","vid","vif","vig","vil","vin","vis","vit","viv","vka","vki","vkj","vkk","vkl","vkm","vko","vkp","vkt","vku","vlp","vls","vma","vmb","vmc","vmd","vme","vmf","vmg","vmh","vmi","vmj","vmk","vml","vmm","vmp","vmq","vmr","vms","vmu","vmv","vmw","vmx","vmy","vmz","vnk","vnm","vnp","vor","vot","vra","vro","vrs","vrt","vsi","vsl","vsv","vto","vum","vun","vut","vwa","waa","wab","wac","wad","wae","waf","wag","wah","wai","waj","wak","wal","wam","wan","wao","wap","waq","war","was","wat","wau","wav","waw","wax","way","waz","wba","wbb","wbe","wbf","wbh","wbi","wbj","wbk","wbl","wbm","wbp","wbq","wbr","wbs","wbt","wbv","wbw","wca","wci","wdd","wdg","wdj","wdk","wdu","wdy","wea","wec","wed","weg","weh","wei","wem","wen","weo","wep","wer","wes","wet","weu","wew","wfg","wga","wgb","wgg","wgi","wgo","wgu","wgw","wgy","wha","whg","whk","whu","wib","wic","wie","wif","wig","wih","wii","wij","wik","wil","wim","win","wir","wit","wiu","wiv","wiw","wiy","wja","wji","wka","wkb","wkd","wkl","wku","wkw","wky","wla","wlc","wle","wlg","wli","wlk","wll","wlm","wlo","wlr","wls","wlu","wlv","wlw","wlx","wly","wma","wmb","wmc","wmd","wme","wmh","wmi","wmm","wmn","wmo","wms","wmt","wmw","wmx","wnb","wnc","wnd","wne","wng","wni","wnk","wnm","wnn","wno","wnp","wnu","wnw","wny","woa","wob","woc","wod","woe","wof","wog","woi","wok","wom","won","woo","wor","wos","wow","woy","wpc","wra","wrb","wrd","wrg","wrh","wri","wrk","wrl","wrm","wrn","wro","wrp","wrr","wrs","wru","wrv","wrw","wrx","wry","wrz","wsa","wsg","wsi","wsk","wsr","wss","wsu","wsv","wtf","wth","wti","wtk","wtm","wtw","wua","wub","wud","wuh","wul","wum","wun","wur","wut","wuu","wuv","wux","wuy","wwa","wwb","wwo","wwr","www","wxa","wxw","wya","wyb","wyi","wym","wyr","wyy","xaa","xab","xac","xad","xae","xag","xai","xaj","xak","xal","xam","xan","xao","xap","xaq","xar","xas","xat","xau","xav","xaw","xay","xba","xbb","xbc","xbd","xbe","xbg","xbi","xbj","xbm","xbn","xbo","xbp","xbr","xbw","xbx","xby","xcb","xcc","xce","xcg","xch","xcl","xcm","xcn","xco","xcr","xct","xcu","xcv","xcw","xcy","xda","xdc","xdk","xdm","xdo","xdy","xeb","xed","xeg","xel","xem","xep","xer","xes","xet","xeu","xfa","xga","xgb","xgd","xgf","xgg","xgi","xgl","xgm","xgn","xgr","xgu","xgw","xha","xhc","xhd","xhe","xhr","xht","xhu","xhv","xia","xib","xii","xil","xin","xip","xir","xis","xiv","xiy","xjb","xjt","xka","xkb","xkc","xkd","xke","xkf","xkg","xkh","xki","xkj","xkk","xkl","xkn","xko","xkp","xkq","xkr","xks","xkt","xku","xkv","xkw","xkx","xky","xkz","xla","xlb","xlc","xld","xle","xlg","xli","xln","xlo","xlp","xls","xlu","xly","xma","xmb","xmc","xmd","xme","xmf","xmg","xmh","xmj","xmk","xml","xmm","xmn","xmo","xmp","xmq","xmr","xms","xmt","xmu","xmv","xmw","xmx","xmy","xmz","xna","xnb","xnd","xng","xnh","xni","xnk","xnn","xno","xnr","xns","xnt","xnu","xny","xnz","xoc","xod","xog","xoi","xok","xom","xon","xoo","xop","xor","xow","xpa","xpc","xpe","xpg","xpi","xpj","xpk","xpm","xpn","xpo","xpp","xpq","xpr","xps","xpt","xpu","xpy","xqa","xqt","xra","xrb","xrd","xre","xrg","xri","xrm","xrn","xrq","xrr","xrt","xru","xrw","xsa","xsb","xsc","xsd","xse","xsh","xsi","xsj","xsl","xsm","xsn","xso","xsp","xsq","xsr","xss","xsu","xsv","xsy","xta","xtb","xtc","xtd","xte","xtg","xth","xti","xtj","xtl","xtm","xtn","xto","xtp","xtq","xtr","xts","xtt","xtu","xtv","xtw","xty","xtz","xua","xub","xud","xug","xuj","xul","xum","xun","xuo","xup","xur","xut","xuu","xve","xvi","xvn","xvo","xvs","xwa","xwc","xwd","xwe","xwg","xwj","xwk","xwl","xwo","xwr","xwt","xww","xxb","xxk","xxm","xxr","xxt","xya","xyb","xyj","xyk","xyl","xyt","xyy","xzh","xzm","xzp","yaa","yab","yac","yad","yae","yaf","yag","yah","yai","yaj","yak","yal","yam","yan","yao","yap","yaq","yar","yas","yat","yau","yav","yaw","yax","yay","yaz","yba","ybb","ybd","ybe","ybh","ybi","ybj","ybk","ybl","ybm","ybn","ybo","ybx","yby","ych","ycl","ycn","ycp","yda","ydd","yde","ydg","ydk","yds","yea","yec","yee","yei","yej","yel","yen","yer","yes","yet","yeu","yev","yey","yga","ygi","ygl","ygm","ygp","ygr","ygs","ygu","ygw","yha","yhd","yhl","yhs","yia","yif","yig","yih","yii","yij","yik","yil","yim","yin","yip","yiq","yir","yis","yit","yiu","yiv","yix","yiy","yiz","yka","ykg","yki","ykk","ykl","ykm","ykn","yko","ykr","ykt","yku","yky","yla","ylb","yle","ylg","yli","yll","ylm","yln","ylo","ylr","ylu","yly","yma","ymb","ymc","ymd","yme","ymg","ymh","ymi","ymk","yml","ymm","ymn","ymo","ymp","ymq","ymr","yms","ymt","ymx","ymz","yna","ynd","yne","yng","ynh","ynk","ynl","ynn","yno","ynq","yns","ynu","yob","yog","yoi","yok","yol","yom","yon","yos","yot","yox","yoy","ypa","ypb","ypg","yph","ypk","ypm","ypn","ypo","ypp","ypz","yra","yrb","yre","yri","yrk","yrl","yrm","yrn","yro","yrs","yrw","yry","ysc","ysd","ysg","ysl","ysn","yso","ysp","ysr","yss","ysy","yta","ytl","ytp","ytw","yty","yua","yub","yuc","yud","yue","yuf","yug","yui","yuj","yuk","yul","yum","yun","yup","yuq","yur","yut","yuu","yuw","yux","yuy","yuz","yva","yvt","ywa","ywg","ywl","ywn","ywq","ywr","ywt","ywu","yww","yxa","yxg","yxl","yxm","yxu","yxy","yyr","yyu","yyz","yzg","yzk","zaa","zab","zac","zad","zae","zaf","zag","zah","zai","zaj","zak","zal","zam","zao","zap","zaq","zar","zas","zat","zau","zav","zaw","zax","zay","zaz","zbc","zbe","zbl","zbt","zbw","zca","zch","zdj","zea","zeg","zeh","zen","zga","zgb","zgh","zgm","zgn","zgr","zhb","zhd","zhi","zhn","zhw","zhx","zia","zib","zik","zil","zim","zin","zir","ziw","ziz","zka","zkb","zkd","zkg","zkh","zkk","zkn","zko","zkp","zkr","zkt","zku","zkv","zkz","zle","zlj","zlm","zln","zlq","zls","zlw","zma","zmb","zmc","zmd","zme","zmf","zmg","zmh","zmi","zmj","zmk","zml","zmm","zmn","zmo","zmp","zmq","zmr","zms","zmt","zmu","zmv","zmw","zmx","zmy","zmz","zna","znd","zne","zng","znk","zns","zoc","zoh","zom","zoo","zoq","zor","zos","zpa","zpb","zpc","zpd","zpe","zpf","zpg","zph","zpi","zpj","zpk","zpl","zpm","zpn","zpo","zpp","zpq","zpr","zps","zpt","zpu","zpv","zpw","zpx","zpy","zpz","zqe","zra","zrg","zrn","zro","zrp","zrs","zsa","zsk","zsl","zsm","zsr","zsu","zte","ztg","ztl","ztm","ztn","ztp","ztq","zts","ztt","ztu","ztx","zty","zua","zuh","zum","zun","zuy","zwa","zxx","zyb","zyg","zyj","zyn","zyp","zza","zzj"];return axe.utils.validLangs=function(){"use strict";return b},commons}()})}("object"==typeof window?window:this);
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/csv_compare.py
|
"""
Qxf2 Services: Utility script to compare two csv files.
"""
import csv,os
class Csv_Compare():
def is_equal(self,csv_actual,csv_expected):
"Method to compare the Actual and Expected csv file"
result_flag = True
if not os.path.exists(csv_actual):
result_flag = False
print('Could not locate the csv file: %s'%csv_actual)
if not os.path.exists(csv_expected):
result_flag = False
print('Could not locate the csv file: %s'%csv_expected)
if os.path.exists(csv_actual) and os.path.exists(csv_expected):
#Open the csv file and put the content to list
with open(csv_actual, 'r') as actual_csvfile, open(csv_expected, 'r') as exp_csvfile:
reader = csv.reader(actual_csvfile)
actual_file = [row for row in reader]
reader = csv.reader(exp_csvfile)
exp_file = [row for row in reader]
if (len(actual_file)!= len(exp_file)):
result_flag = False
print("Mismatch in number of rows. The actual row count didn't match with expected row count")
else:
for actual_row, actual_col in zip(actual_file,exp_file):
if actual_row == actual_col:
pass
else:
print("Mismatch between actual and expected file at Row: ",actual_file.index(actual_row))
print("Row present only in Actual file: %s"%actual_row)
print("Row present only in Expected file: %s"%actual_col)
result_flag = False
return result_flag
#---USAGE EXAMPLES
if __name__=='__main__':
print("Start of %s"%__file__)
#Fill in the file1 and file2 paths
file1 = 'Add path for the first file here'
file2 = 'Add path for the second file here'
#Initialize the csv object
csv_obj = Csv_Compare()
#Sample code to compare csv files
if csv_obj.is_equal(file1,file2) is True:
print("Data matched in both the csv files\n")
else:
print("Data mismatch between the actual and expected csv files")
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/Wrapit.py
|
"""
Class to hold miscellaneous but useful decorators for our framework
"""
from inspect import getfullargspec
import traceback
class Wrapit():
"Wrapit class to hold decorator functions"
def _exceptionHandler(f):
"Decorator to handle exceptions"
def inner(*args,**kwargs):
try:
return f(*args,**kwargs)
except Exception as e:
#args[0].write('You have this exception', level='error')
trace = traceback.format_exc(limit=-1)
# Create a message with the traceback details
message = f"You have this exception: {str(e)}\n{trace}"
args[0].write(message, level='error', trace_back=trace)
#traceback.print_exc(limit=-1)
#we denote None as failure case
return None
return inner
def _screenshot(func):
"Decorator for taking screenshots"
#Usage: Make this the first decorator to a method (right above the 'def function_name' line)
#Otherwise, we cannot name the screenshot with the name of the function that called it
def wrapper(*args,**kwargs):
result = func(*args,**kwargs)
screenshot_name = '%003d'%args[0].screenshot_counter + '_' + func.__name__
args[0].screenshot_counter += 1
args[0].save_screenshot(screenshot_name)
return result
return wrapper
def _check_browser_console_log(func):
"Decorator to check the browser's console log for errors"
def wrapper(*args,**kwargs):
#As IE driver does not support retrieval of any logs,
#we are bypassing the read_browser_console_log() method
result = func(*args, **kwargs)
if "ie" not in str(args[0].driver):
result = func(*args, **kwargs)
log_errors = []
new_errors = []
log = args[0].read_browser_console_log()
if log != None:
for entry in log:
if entry['level']=='SEVERE':
log_errors.append(entry['message'])
if args[0].current_console_log_errors != log_errors:
#Find the difference
new_errors = list(set(log_errors) - set(args[0].current_console_log_errors))
#Set current_console_log_errors = log_errors
args[0].current_console_log_errors = log_errors
if len(new_errors)>0:
args[0].failure("\nBrowser console error on url: %s\nMethod: %s\nConsole error(s):%s"%(args[0].get_current_url(),func.__name__,'\n----'.join(new_errors)))
return result
return wrapper
_exceptionHandler = staticmethod(_exceptionHandler)
_screenshot = staticmethod(_screenshot)
_check_browser_console_log = staticmethod(_check_browser_console_log)
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/utils/copy_framework_template.py
|
r"""
This script would copy the required framework files from the input source to
the input destination given by the user.
1. Copy root files from POM to the newly created destination directory.
2. Create the sub-folder to copy files from POM\conf.
3. Create the sub-folder to copy files from POM\page_objects.
4. Create the sub-folder to copy files and folders from POM\utils.
5. Create the sub-folder to copy files and folders from POM\core_helpers
6. Create the sub-folder to copy files and folders from POM\integrations
7. Create the sub-folder to copy files from POM\tests
From root directory, run following command to execute the script correctly.
python utils/copy_framework_template.py -s . -d ../copy_pom_temp/
"""
import os
import sys
import argparse
import shutil
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from conf import copy_framework_template_conf as conf
def copy_selected_files(file_list,dst_folder):
"copy selected files into destination folder"
# Create the new destination directory
if not os.path.exists(dst_folder):
os.makedirs(dst_folder)
# Check if destination folder exists and then copy files
if os.path.exists(dst_folder):
for every_src_file in file_list:
shutil.copy2(every_src_file,dst_folder)
def copy_contents(src_folder, dst_folder, exclude_dirs=None):
"Copy all content from source directory to destination directory"
if exclude_dirs is None:
exclude_dirs = ['__pycache__']
# Create destination folder if it doesn't exist
if not os.path.exists(dst_folder):
os.makedirs(dst_folder)
for root, dirs, files in os.walk(src_folder):
# Exclude specified directories
dirs[:] = [d for d in dirs if d not in exclude_dirs]
# Calculate relative path
rel_path = os.path.relpath(root, src_folder)
dst_path = os.path.join(dst_folder, rel_path)
# Create directories in the destination folder
if not os.path.exists(dst_path):
os.makedirs(dst_path)
# Copy files
for file in files:
src_file = os.path.join(root, file)
dst_file = os.path.join(dst_path, file)
shutil.copy2(src_file, dst_file)
def copy_framework_template(src_folder,dst_folder):
"Copy files from POM to the destination directory path."
# Get details from conf file
src_files_list = conf.src_files_list # root files list to copy
#copy selected files from source root
copy_selected_files(src_files_list,dst_folder)
#2. Create the sub-folder to copy files from POM\conf.
# Get details from conf file for Conf
src_conf_files_list = conf.src_conf_files_list
dst_folder_conf = os.path.abspath(os.path.join(dst_folder,'conf'))
#copy selected files from source conf directory
copy_selected_files(src_conf_files_list,dst_folder_conf)
#3. Create the sub-folder to copy files from POM\page_objects.
#3 Get details from conf file for Page_Objects
src_page_objects_files_list = conf.src_page_objects_files_list
dst_folder_page_objects = os.path.abspath(os.path.join(dst_folder,'page_objects'))
#copy selected files from source page_objeccts directory
copy_selected_files(src_page_objects_files_list,dst_folder_page_objects)
#4. Create the sub-folder to copy files from POM\utils.
# utils directory paths
src_folder_utils = os.path.abspath(os.path.join(src_folder,'utils'))
dst_folder_utils = os.path.abspath(os.path.join(dst_folder,'utils'))
#copy all contents from source utils directory
copy_contents(src_folder_utils,dst_folder_utils)
#5. Create the sub-folder to copy files from POM\core_helpers
# core helpers directory paths
src_folder_core_helpers = os.path.abspath(os.path.join(src_folder,'core_helpers'))
dst_folder_core_helpers = os.path.abspath(os.path.join(dst_folder,'core_helpers'))
#copy all contents from source core_helpers directory
copy_contents(src_folder_core_helpers,dst_folder_core_helpers)
#6. Create the sub-folder to copy files from POM\integrations
# integrations directory paths
src_folder_integrations = os.path.abspath(os.path.join(src_folder,'integrations'))
dst_folder_integrations = os.path.abspath(os.path.join(dst_folder,'integrations'))
#copy all contents from source integrations directory
copy_contents(src_folder_integrations,dst_folder_integrations)
#7. Create the sub-folder to copy files from POM\tests.
# Get details from conf file for Conf
src_tests_files_list = conf.src_tests_files_list
dst_folder_tests = os.path.abspath(os.path.join(dst_folder,'tests'))
#copy selected files from source page_objeccts directory
copy_selected_files(src_tests_files_list,dst_folder_tests)
print(f"Template copied to destination {os.path.abspath(dst_folder)} successfully")
#---START OF SCRIPT
if __name__=='__main__':
#run the test
parser=argparse.ArgumentParser(description="Copy framework template.")
parser.add_argument("-s","--source",dest="src",
help="The name of the source folder: ie, POM",default=".")
parser.add_argument("-d","--destination",dest="dst",
help="The name of the destination folder: ie, client name",
default="../copy_pom_templete/")
args = parser.parse_args()
copy_framework_template(args.src,args.dst)
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/cross_browsers/remote_options.py
|
"""
Set the desired option for running the test on a remote platform.
"""
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.ie.options import Options as IeOptions
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.safari.options import Options as SafariOptions
from appium.options.android import UiAutomator2Options
from appium import webdriver as mobile_webdriver
class RemoteOptions():
"""Class contains methods for various remote options for browserstack and saucelab."""
@staticmethod
def firefox(browser_version):
"""Set web browser as firefox."""
options = FirefoxOptions()
options.browser_version = browser_version
return options
@staticmethod
def explorer(browser_version):
"""Set web browser as Explorer."""
options = IeOptions()
options.browser_version = browser_version
return options
@staticmethod
def chrome(browser_version):
"""Set web browser as Chrome."""
options = ChromeOptions()
options.browser_version = browser_version
return options
@staticmethod
def safari(browser_version):
"""Set web browser as Safari."""
options = SafariOptions()
options.browser_version = browser_version
return options
def get_browser(self, browser, browser_version):
"""Select the browser."""
if browser.lower() == 'ff' or browser.lower() == 'firefox':
desired_capabilities = self.firefox(browser_version)
elif browser.lower() == 'ie':
desired_capabilities = self.explorer(browser_version)
elif browser.lower() == 'chrome':
desired_capabilities = self.chrome(browser_version)
elif browser.lower() == 'safari':
desired_capabilities = self.safari(browser_version)
else:
print(f"\nDriverFactory does not know the browser\t{browser}\n")
desired_capabilities = None
return desired_capabilities
def remote_project_name(self, desired_capabilities, remote_project_name):
"""Set remote project name for browserstack."""
desired_capabilities['projectName'] = remote_project_name
return desired_capabilities
def remote_build_name(self, desired_capabilities, remote_build_name):
"""Set remote build name for browserstack."""
from datetime import datetime
desired_capabilities['buildName'] = remote_build_name+"_"+str(datetime.now().strftime("%c"))
return desired_capabilities
def set_capabilities_options(self, desired_capabilities, url):
"""Set the capabilities options for the mobile driver."""
capabilities_options = UiAutomator2Options().load_capabilities(desired_capabilities)
mobile_driver = mobile_webdriver.Remote(command_executor=url,options=capabilities_options)
return mobile_driver
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/cross_browsers/saucelab_runner.py
|
"""
Get the webdriver and mobiledriver for SauceLab.
"""
import os
from selenium import webdriver
from integrations.cross_browsers.remote_options import RemoteOptions
from conf import remote_url_conf
class SauceLabRunner(RemoteOptions):
"""Configure and get the webdriver and the mobiledriver for SauceLab"""
def __init__(self):
self.username = os.getenv('REMOTE_USERNAME')
self.password = os.getenv('REMOTE_ACCESS_KEY')
self.saucelabs_url = remote_url_conf.saucelabs_url
self.saucelabs_app_upload_url = remote_url_conf.saucelabs_app_upload_url
def saucelab_credentials(self, sauce_options):
"""Set saucelab credentials."""
sauce_options['username'] = self.username
sauce_options['accessKey'] = self.password
return sauce_options
def saucelab_capabilities(self, desired_capabilities, app_name):
"""Set saucelab capabilities"""
desired_capabilities['appium:app'] = 'storage:filename='+app_name
desired_capabilities['autoAcceptAlerts'] = 'true'
sauce_mobile_options = {}
sauce_mobile_options = self.saucelab_credentials(sauce_mobile_options)
desired_capabilities['sauce:options'] = sauce_mobile_options
return desired_capabilities
def saucelab_platform(self, options, os_name, os_version):
"""Set platform for saucelab."""
options.platform_name = os_name + ' '+os_version
return options
def sauce_upload(self,app_path, app_name, timeout=30):
"""Upload the apk to the sauce temperory storage."""
import requests
from requests.auth import HTTPBasicAuth
result_flag = False
try:
apk_file_path = os.path.join(app_path, app_name)
# Open the APK file in binary mode
with open(apk_file_path, 'rb') as apk_file:
files = {'payload': (app_name, apk_file, 'application/vnd.android.package-archive')}
params = {'name': app_name, 'overwrite': 'true'}
# Perform the upload request
response = requests.post(self.saucelabs_app_upload_url,
auth=HTTPBasicAuth(self.username, self.password),
files=files, params=params, timeout=timeout)
# Check the response
if response.status_code == 201:
result_flag = True
print('App successfully uploaded to sauce storage')
#print('Response:', response.json())
else:
print('App upload failed!')
print('Status code:', response.status_code)
print('Response:', response.text)
raise Exception("Failed to upload APK file." +
f"Status code: {response.status_code}")
except Exception as exception:
print(str(exception))
return result_flag
def get_saucelab_mobile_driver(self, app_path, app_name, desired_capabilities):
"""Setup mobile driver to run the test in Saucelab."""
#Saucelabs expects the app to be uploaded to Sauce storage everytime the test is run
result_flag = self.sauce_upload(app_path, app_name)
if result_flag:
desired_capabilities = self.saucelab_capabilities(desired_capabilities, app_name)
mobile_driver = self.set_capabilities_options(desired_capabilities,
url=self.saucelabs_url)
else:
print("Failed to upload an app file")
raise Exception("Failed to upload APK file.")
return mobile_driver
def get_saucelab_webdriver(self, os_name, os_version, browser, browser_version):
"""Setup webdriver to run the test in Saucelab."""
#set browser
options = self.get_browser(browser, browser_version)
#set saucelab platform
options = self.saucelab_platform(options, os_name, os_version)
sauce_options = {}
sauce_options = self.saucelab_credentials(sauce_options)
options.set_capability('sauce:options', sauce_options)
web_driver = webdriver.Remote(command_executor=self.saucelabs_url, options=options)
return web_driver
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/cross_browsers/browserstack_runner.py
|
"""
Get the webdriver and mobiledriver for BrowserStack.
"""
import os
from selenium import webdriver
from integrations.cross_browsers.remote_options import RemoteOptions
from conf import screenshot_conf
from conf import remote_url_conf
class BrowserStackRunner(RemoteOptions):
"""Configure and get the webdriver and the mobiledriver for BrowserStack"""
def __init__(self):
self.username = os.getenv('REMOTE_USERNAME')
self.password = os.getenv('REMOTE_ACCESS_KEY')
self.browserstack_url = remote_url_conf.browserstack_url
self.browserstack_app_upload_url = remote_url_conf.browserstack_app_upload_url
def browserstack_credentials(self, browserstack_options):
"""Set browserstack credentials."""
browserstack_options['userName'] = self.username
browserstack_options['accessKey'] = self.password
return browserstack_options
def browserstack_capabilities(self, desired_capabilities, app_name, app_path, appium_version):
"""Configure browserstack capabilities"""
bstack_mobile_options = {}
bstack_mobile_options['idleTimeout'] = 300
bstack_mobile_options['sessionName'] = 'Appium Python Test'
bstack_mobile_options['appiumVersion'] = appium_version
bstack_mobile_options['realMobile'] = 'true'
bstack_mobile_options = self.browserstack_credentials(bstack_mobile_options)
#upload the application to the Browserstack Storage
desired_capabilities['app'] = self.browserstack_upload(app_name, app_path)
desired_capabilities['bstack:options'] = bstack_mobile_options
return desired_capabilities
def browserstack_snapshots(self, desired_capabilities):
"""Set browserstack snapshots"""
desired_capabilities['debug'] = str(screenshot_conf.BS_ENABLE_SCREENSHOTS).lower()
return desired_capabilities
def browserstack_upload(self, app_name, app_path, timeout = 30):
"""Upload the apk to the BrowserStack storage if its not done earlier."""
try:
#Upload the apk
import requests
import json
apk_file = os.path.join(app_path, app_name)
files = {'file': open(apk_file, 'rb')}
post_response = requests.post(self.browserstack_app_upload_url, files=files,
auth=(self.username, self.password),timeout= timeout)
post_response.raise_for_status()
post_json_data = json.loads(post_response.text)
#Get the app url of the newly uploaded apk
app_url = post_json_data['app_url']
return app_url
except Exception as exception:
print('\033[91m'+"\nError while uploading the app:%s"%str(exception)+'\033[0m')
def get_current_session_url(self, web_driver):
"Get current session url"
import json
current_session = web_driver.execute_script('browserstack_executor: {"action": "getSessionDetails"}')
session_details = json.loads(current_session)
# Check if 'public_url' exists and is not None
if 'public_url' in session_details and session_details['public_url'] is not None:
session_url = session_details['public_url']
else:
session_url = session_details['browser_url']
return session_url
def set_os(self, desired_capabilities, os_name, os_version):
"""Set os name and os_version."""
desired_capabilities['os'] = os_name
desired_capabilities['osVersion'] = os_version
return desired_capabilities
def get_browserstack_mobile_driver(self, app_path, app_name, desired_capabilities,
appium_version):
"""Setup mobile driver to run the test in Browserstack."""
desired_capabilities = self.browserstack_capabilities(desired_capabilities, app_name,
app_path, appium_version)
mobile_driver = self.set_capabilities_options(desired_capabilities,
url=self.browserstack_url)
session_url = self.get_current_session_url(mobile_driver)
return mobile_driver,session_url
def get_browserstack_webdriver(self, os_name, os_version, browser, browser_version,
remote_project_name, remote_build_name):
"""Run the test in browserstack when remote flag is 'Y'."""
#Set browser
options = self.get_browser(browser, browser_version)
desired_capabilities = {}
#Set os and os_version
desired_capabilities = self.set_os(desired_capabilities, os_name, os_version)
#Set remote project name
if remote_project_name is not None:
desired_capabilities = self.remote_project_name(desired_capabilities,
remote_project_name)
#Set remote build name
if remote_build_name is not None:
desired_capabilities = self.remote_build_name(desired_capabilities, remote_build_name)
desired_capabilities = self.browserstack_snapshots(desired_capabilities)
desired_capabilities = self.browserstack_credentials(desired_capabilities)
options.set_capability('bstack:options', desired_capabilities)
web_driver = webdriver.Remote(command_executor=self.browserstack_url, options=options)
session_url = self.get_current_session_url(web_driver)
return web_driver, session_url
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/cross_browsers/lambdatest_runner.py
|
"""
Get the webdriver for LambdaTest browsers.
"""
import os
import time
import requests
from selenium import webdriver
from integrations.cross_browsers.remote_options import RemoteOptions
from conf import remote_url_conf
class LambdaTestRunner(RemoteOptions):
"""Configure and get the webdriver for the LambdaTest"""
def __init__(self):
self.username = os.getenv('REMOTE_USERNAME')
self.password = os.getenv('REMOTE_ACCESS_KEY')
self.lambdatest_url = remote_url_conf.lambdatest_url.format(self.username, self.password)
self.lambdatest_api_server_url = remote_url_conf.lambdatest_api_server_url
self.session_id = None
self.session_url = None
def lambdatest_credentials(self, lambdatest_options):
"""Set LambdaTest credentials."""
lambdatest_options['user'] = self.username
lambdatest_options['accessKey'] = self.password
return lambdatest_options
def set_lambdatest_capabilities(self,remote_project_name, remote_build_name, testname):
"""Set LambdaTest Capabilities"""
lambdatest_options = {}
lambdatest_options = self.lambdatest_credentials(lambdatest_options)
lambdatest_options["build"] = remote_build_name
lambdatest_options["project"] = remote_project_name
lambdatest_options["name"] = testname
lambdatest_options["video"] = True
lambdatest_options["visual"] = True
lambdatest_options["network"] = True
lambdatest_options["w3c"] = True
lambdatest_options["console"] = True
lambdatest_options["plugin"] = "python-pytest"
return lambdatest_options
def get_lambdatest_webdriver(self, os_name, os_version, browser, browser_version,
remote_project_name, remote_build_name, testname):
"""Run the test in LambdaTest when remote flag is 'Y'."""
options = self.get_browser(browser, browser_version)
if options is None:
raise ValueError(f"Unsupported browser: {browser}")
# Set LambdaTest platform
options.platformName = f"{os_name} {os_version}"
lambdatest_options = self.set_lambdatest_capabilities(remote_project_name,remote_build_name,
testname)
options.set_capability('LT:options', lambdatest_options)
web_driver = webdriver.Remote(command_executor=self.lambdatest_url, options=options)
# Get the session ID and session URL and print it
self.session_id = web_driver.session_id
self.session_url = self.get_session_url_with_retries(self.session_id)
return web_driver,self.session_url
def get_session_url_with_retries(self, session_id, retries=5, delay=2, timeout=30):
"""Fetch the session URL using the LambdaTest API with retries."""
api_url = f"{self.lambdatest_api_server_url}/sessions/{session_id}"
time.sleep(2)
for _ in range(retries):
response = requests.get(api_url, auth=(self.username, self.password),timeout=timeout)
if response.status_code == 200:
session_data = response.json()
test_id = session_data['data']['test_id']
session_url = f"https://automation.lambdatest.com/test?testID={test_id}"
return session_url
else:
print(f"Retrying... Status code: {response.status_code}, Response: {response.text}")
time.sleep(delay)
raise Exception(f"Failed to fetch session details after {retries} retries.")
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/cross_browsers/BrowserStack_Library.py
|
"""
First version of a library to interact with BrowserStack's artifacts.
For now, this is useful for:
a) Obtaining the session URL
b) Obtaining URLs of screenshots
To do:
a) Handle expired sessions better
"""
import os
import requests
from conf import remote_url_conf
class BrowserStack_Library():
"BrowserStack library to interact with BrowserStack artifacts"
def __init__(self):
"Constructor for the BrowserStack library"
self.browserstack_api_server_url = remote_url_conf.browserstack_api_server_url
self.browserstack_cloud_api_server_url = remote_url_conf.browserstack_cloud_api_server_url
self.auth = self.get_auth()
def get_auth(self):
"Set up the auth object for the Requests library"
USERNAME = os.getenv('REMOTE_USERNAME')
PASSWORD = os.getenv('REMOTE_ACCESS_KEY')
auth = (USERNAME,PASSWORD)
return auth
def get_build_id(self,timeout=10):
"Get the build ID"
build_url = self.browserstack_api_server_url + "/builds.json?status=running"
builds = requests.get(build_url, auth=self.auth, timeout=timeout).json()
build_id = builds[0]['automation_build']['hashed_id']
return build_id
def get_sessions(self,timeout=10):
"Get a JSON object with all the sessions"
build_id = self.get_build_id()
sessions= requests.get(f'{self.browserstack_api_server_url}/builds/{build_id}/sessions.json?browserstack_status=running', auth=self.auth, timeout=timeout).json()
return sessions
def get_active_session_details(self):
"Return the session ID of the first active session"
session_details = None
sessions = self.get_sessions()
for session in sessions:
#Get session id of the first session with status = running
if session['automation_session']['status']=='running':
session_details = session['automation_session']
#session_id = session['automation_session']['hashed_id']
#session_url = session['automation_session']['browser_url']
break
return session_details
def extract_session_id(self, session_url):
"Extract session id from session url"
import re
# Use regex to match the session ID, which is a 40-character hexadecimal string
match = re.search(r'/sessions/([a-f0-9]{40})', session_url)
if match:
return match.group(1)
else:
return None
def upload_terminal_logs(self, file_path, session_id = None, appium_test = False, timeout=30):
"Upload the terminal log to BrowserStack"
try:
# Get session ID if not provided
if session_id is None:
session_details = self.get_active_session_details()
session_id = session_details['hashed_id']
if not session_id:
raise ValueError("Session ID could not be retrieved. Check active session details.")
# Determine the URL based on the type of test
if appium_test:
url = f'{self.browserstack_cloud_api_server_url}/app-automate/sessions/{session_id}/terminallogs'
else:
url = f'{self.browserstack_cloud_api_server_url}/automate/sessions/{session_id}/terminallogs'
# Open the file using a context manager to ensure it is properly closed
with open(file_path, 'rb') as file:
files = {'file': file}
# Make the POST request to upload the file
response = requests.post(url, auth=self.auth, files=files, timeout=timeout)
# Check if the request was successful
if response.status_code == 200:
print("Log file uploaded to BrowserStack session successfully.")
else:
print(f"Failed to upload log file. Status code: {response.status_code}")
print(response.text)
return response
except FileNotFoundError as e:
print(f"Error: Log file '{file_path}' not found.")
return {"error": "Log file not found.", "details": str(e)}
except ValueError as e:
print(f"Error: {str(e)}")
return {"error": "Invalid session ID.", "details": str(e)}
except requests.exceptions.RequestException as e:
# Handle network-related errors
print(f"Error: Failed to upload log file to BrowserStack. Network error: {str(e)}")
return {"error": "Network error during file upload.", "details": str(e)}
except Exception as e:
# Catch any other unexpected errors
print(f"An unexpected error occurred: {str(e)}")
return {"error": "Unexpected error occurred during file upload.", "details": str(e)}
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_tools/Test_Rail.py
|
"""
TestRail integration:
* limited to what we need at this time
* we assume TestRail operates in single suite mode
i.e., the default, reccomended mode
API reference: http://docs.gurock.com/testrail-api2/start
"""
import os,sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from integrations.reporting_tools import testrail_client
class Test_Rail:
"Wrapper around TestRail's API"
# Added below to fix PytestCollectionWarning
__test__ = False
def __init__(self):
"Initialize the TestRail objects"
self.set_testrail_conf()
def set_testrail_conf(self):
"Set the TestRail URL and username, password"
try :
#Set the TestRail URL
self.testrail_url = os.getenv('testrail_url')
self.client = testrail_client.APIClient(self.testrail_url)
#TestRail User and Password
self.client.user = os.getenv('testrail_user')
self.client.password = os.getenv('testrail_password')
except Exception as e:
solution ="It looks like you are trying to configure TestRail to run your test. \nPlease make sure you have updated .env with the right credentials . \nReadme is updated with the necessary details, kindly go through it."
print('\033[91m'+"\nException when trying to get remote webdriver:%s"%sys.modules[__name__]+'\033[0m')
print('\033[91m'+"\nPython says:%s"%str(e)+'\033[0m')
print('\033[92m'+"\nSOLUTION: %s\n"%solution+'\033[0m')
def get_project_id(self,project_name):
"Get the project ID using project name"
project_id=None
projects = self.client.send_get('get_projects')
for project in projects:
if project['name'] == project_name:
project_id = project['id']
break
return project_id
def get_suite_id(self,project_name,suite_name):
"Get the suite ID using project name and suite name"
suite_id=None
project_id = self.get_project_id(project_name)
suites = self.client.send_get('get_suites/%s'%(project_id))
for suite in suites:
if suite['name'] == suite_name:
suite_id = suite['id']
break
return suite_id
def get_milestone_id(self,project_name,milestone_name):
"Get the milestone ID using project name and milestone name"
milestone_id = None
project_id = self.get_project_id(project_name)
milestones = self.client.send_get('get_milestones/%s'%(project_id))
for milestone in milestones:
if milestone['name'] == milestone_name:
milestone_id = milestone['id']
break
return milestone_id
def get_user_id(self,user_name):
"Get the user ID using user name"
user_id=None
users = self.client.send_get('get_users')
for user in users:
if user['name'] == user_name:
user_id = user['id']
break
return user_id
def get_run_id(self,project_name,test_run_name):
"Get the run ID using test name and project name"
run_id=None
project_id = self.get_project_id(project_name)
try:
test_runs = self.client.send_get('get_runs/%s'%(project_id))
except Exception as e:
print('Exception in update_testrail() updating TestRail.')
print('PYTHON SAYS: ')
print(e)
else:
for test_run in test_runs:
if test_run['name'] == test_run_name:
run_id = test_run['id']
break
return run_id
def create_milestone(self,project_name,milestone_name,milestone_description=""):
"Create a new milestone if it does not already exist"
milestone_id = self.get_milestone_id(project_name,milestone_name)
if milestone_id is None:
project_id = self.get_project_id(project_name)
if project_id is not None:
try:
data = {'name':milestone_name,
'description':milestone_description}
self.client.send_post('add_milestone/%s'%str(project_id),
data)
except Exception as e:
print('Exception in create_new_project() creating new project.')
print('PYTHON SAYS: ')
print(e)
else:
print('Created the milestone: %s'%milestone_name)
else:
print("Milestone '%s' already exists"%milestone_name)
def create_new_project(self,new_project_name,project_description,show_announcement,suite_mode):
"Create a new project if it does not already exist"
project_id = self.get_project_id(new_project_name)
if project_id is None:
try:
self.client.send_post('add_project',
{'name': new_project_name,
'announcement': project_description,
'show_announcement': show_announcement,
'suite_mode': suite_mode,})
except Exception as e:
print('Exception in create_new_project() creating new project.')
print('PYTHON SAYS: ')
print(e)
else:
print("Project already exists %s"%new_project_name)
def create_test_run(self,project_name,test_run_name,milestone_name=None,description="",suite_name=None,case_ids=[],assigned_to=None):
"Create a new test run if it does not already exist"
#reference: http://docs.gurock.com/testrail-api2/reference-runs
project_id = self.get_project_id(project_name)
test_run_id = self.get_run_id(project_name,test_run_name)
if project_id is not None and test_run_id is None:
data = {}
if suite_name is not None:
suite_id = self.get_suite_id(project_name,suite_name)
if suite_id is not None:
data['suite_id'] = suite_id
data['name'] = test_run_name
data['description'] = description
if milestone_name is not None:
milestone_id = self.get_milestone_id(project_name,milestone_name)
if milestone_id is not None:
data['milestone_id'] = milestone_id
if assigned_to is not None:
assignedto_id = self.get_user_id(assigned_to)
if assignedto_id is not None:
data['assignedto_id'] = assignedto_id
if len(case_ids) > 0:
data['case_ids'] = case_ids
data['include_all'] = False
try:
self.client.send_post('add_run/%s'%(project_id),data)
except Exception as e:
print('Exception in create_test_run() Creating Test Run.')
print('PYTHON SAYS: ')
print(e)
else:
print('Created the test run: %s'%test_run_name)
else:
if project_id is None:
print("Cannot add test run %s because Project %s was not found"%(test_run_name,project_name))
elif test_run_id is not None:
print("Test run '%s' already exists"%test_run_name)
def delete_project(self,new_project_name,project_description):
"Delete an existing project"
project_id = self.get_project_id(new_project_name)
if project_id is not None:
try:
self.client.send_post('delete_project/%s'%(project_id),project_description)
except Exception as e:
print('Exception in delete_project() deleting project.')
print('PYTHON SAYS: ')
print(e)
else:
print('Cant delete the project given project name: %s'%(new_project_name))
def delete_test_run(self,test_run_name,project_name):
"Delete an existing test run"
run_id = self.get_run_id(test_run_name,project_name)
if run_id is not None:
try:
self.client.send_post('delete_run/%s'%(run_id),test_run_name)
except Exception as e:
print('Exception in update_testrail() updating TestRail.')
print('PYTHON SAYS: ')
print(e)
else:
print('Cant delete the test run for given project and test run name: %s , %s'%(project_name,test_run_name))
def update_testrail(self,case_id,run_id,result_flag,msg=""):
"Update TestRail for a given run_id and case_id"
update_flag = False
#Update the result in TestRail using send_post function.
#Parameters for add_result_for_case is the combination of runid and case id.
#status_id is 1 for Passed, 2 For Blocked, 4 for Retest and 5 for Failed
status_id = 1 if result_flag is True else 5
if ((run_id is not None) and (case_id != 'None')) :
try:
self.client.send_post(
'add_result_for_case/%s/%s'%(run_id,case_id),
{'status_id': status_id, 'comment': msg })
except Exception as e:
print('Exception in update_testrail() updating TestRail.')
print('PYTHON SAYS: ')
print(e)
else:
print('Updated test result for case: %s in test run: %s\n'%(case_id,run_id))
return update_flag
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_tools/testrail_client.py
|
#
# TestRail API binding for Python 3.x (API v2, available since
# TestRail 3.0)
# Compatible with TestRail 3.0 and later.
#
# Learn more:
#
# http://docs.gurock.com/testrail-api2/start
# http://docs.gurock.com/testrail-api2/accessing
#
# Copyright Gurock Software GmbH. See license.md for details.
#
import requests
import json
import base64
class APIClient:
def __init__(self, base_url):
self.user = ''
self.password = ''
if not base_url.endswith('/'):
base_url += '/'
self.__url = base_url + 'index.php?/api/v2/'
#
# Send Get
#
# Issues a GET request (read) against the API and returns the result
# (as Python dict) or filepath if successful file download
#
# Arguments:
#
# uri The API method to call including parameters
# (e.g. get_case/1)
#
# filepath The path and file name for attachment download
# Used only for 'get_attachment/:attachment_id'
#
def send_get(self, uri, filepath=None):
return self.__send_request('GET', uri, filepath)
#
# Send POST
#
# Issues a POST request (write) against the API and returns the result
# (as Python dict).
#
# Arguments:
#
# uri The API method to call including parameters
# (e.g. add_case/1)
# data The data to submit as part of the request (as
# Python dict, strings must be UTF-8 encoded)
# If adding an attachment, must be the path
# to the file
#
def send_post(self, uri, data):
return self.__send_request('POST', uri, data)
def __send_request(self, method, uri, data):
url = self.__url + uri
auth = str(
base64.b64encode(
bytes('%s:%s' % (self.user, self.password), 'utf-8')
),
'ascii'
).strip()
headers = {'Authorization': 'Basic ' + auth}
if method == 'POST':
if uri[:14] == 'add_attachment': # add_attachment API method
files = {'attachment': (open(data, 'rb'))}
response = requests.post(url, headers=headers, files=files)
files['attachment'].close()
else:
headers['Content-Type'] = 'application/json'
payload = bytes(json.dumps(data), 'utf-8')
response = requests.post(url, headers=headers, data=payload)
else:
headers['Content-Type'] = 'application/json'
response = requests.get(url, headers=headers)
if response.status_code > 201:
try:
error = response.json()
except: # response.content not formatted as JSON
error = str(response.content)
raise APIError('TestRail API returned HTTP %s (%s)' % (response.status_code, error))
else:
if uri[:15] == 'get_attachment/': # Expecting file, not JSON
try:
open(data, 'wb').write(response.content)
return (data)
except:
return ("Error saving attachment.")
else:
return response.json()
class APIError(Exception):
pass
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_tools/Tesults.py
|
import os
import tesults
cases = []
def add_test_case(data):
cases.append(data)
def post_results_to_tesults ():
" This method is to post the results into the tesults"
# uses default token unless otherwise specified
token = os.getenv('tesults_target_token_default')
if not token:
solution =("It looks like you are trying to use tesults to run your test."
"Please make sure you have updated .env with the right credentials .")
print(f"\033[92m\nSOLUTION: {solution}\n\033[0m")
else:
data = {
'target': token,
'results': { 'cases': cases }
}
print ('-----Tesults output-----')
if len(data['results']['cases']) > 0:
print (data)
print('Uploading results to Tesults...')
ret = tesults.results(data)
print ('success: ' + str(ret['success']))
print ('message: ' + str(ret['message']))
print ('warnings: ' + str(ret['warnings']))
print ('errors: ' + str(ret['errors']))
else:
print ('No test results.')
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_tools/setup_testrail.py
|
"""
One off utility script to setup TestRail for an automated run
This script can:
a) Add a milestone if it does not exist
b) Add a test run (even without a milestone if needed)
c) Add select test cases to the test run using the setup_testrail.conf file
d) Write out the latest run id to a 'latest_test_run.txt' file
This script will NOT:
a) Add a project if it does not exist
"""
import os,ConfigParser,time
from integrations.reporting_tools.Test_Rail import Test_Rail
from optparse import OptionParser
def check_file_exists(file_path):
#Check if the config file exists and is a file
conf_flag = True
if os.path.exists(file_path):
if not os.path.isfile(file_path):
print('\n****')
print('Config file provided is not a file: ')
print(file_path)
print('****')
conf_flag = False
else:
print('\n****')
print('Unable to locate the provided config file: ')
print(file_path)
print('****')
conf_flag = False
return conf_flag
def check_options(options):
"Check if the command line options are valid"
result_flag = True
if options.test_cases_conf is not None:
result_flag = check_file_exists(os.path.abspath(os.path.join(os.path.dirname(__file__),'..','conf',options.test_cases_conf)))
return result_flag
def save_new_test_run_details(filename,test_run_name,test_run_id):
"Write out latest test run name and id"
fp = open(filename,'w')
fp.write('TEST_RUN_NAME=%s\n'%test_run_name)
fp.write('TEST_RUN_ID=%s\n'%str(test_run_id))
fp.close()
def setup_testrail(project_name='POM DEMO',milestone_name=None,test_run_name=None,test_cases_conf=None,description=None,name_override_flag='N',case_ids_list=None):
"Setup TestRail for an automated run"
#1. Get project id
#2. if milestone_name is not None
# create the milestone if it does not already exist
#3. if test_run_name is not None
# create the test run if it does not already exist
# TO DO: if test_cases_conf is not None -> pass ids as parameters
#4. write out test runid to latest_test_run.txt
conf_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','conf'))
config = ConfigParser.ConfigParser()
testrail_object = Test_Rail()
#1. Get project id
project_id = testrail_object.get_project_id(project_name)
if project_id is not None: #i.e., the project exists
#2. if milestone_name is not None:
# create the milestone if it does not already exist
if milestone_name is not None:
testrail_object.create_milestone(project_name,milestone_name)
#3. if test_run_name is not None
# create the test run if it does not already exist
# if test_cases_conf is not None -> pass ids as parameters
if test_run_name is not None:
case_ids = []
#Set the case ids
if case_ids_list is not None:
#Getting case ids from command line
case_ids = case_ids_list.split(',')
else:
#Getting case ids based on given description(test name)
if description is not None:
if check_file_exists(os.path.join(conf_dir,test_cases_conf)):
config.read(os.path.join(conf_dir,test_cases_conf))
case_ids = config.get(description,'case_ids')
case_ids = case_ids.split(',')
#Set test_run_name
if name_override_flag.lower() == 'y':
test_run_name = test_run_name + "-" + time.strftime("%d/%m/%Y/%H:%M:%S") + "_for_"
#Use description as test_run_name
if description is None:
test_run_name = test_run_name + "All"
else:
test_run_name = test_run_name + str(description)
testrail_object.create_test_run(project_name,test_run_name,milestone_name=milestone_name,case_ids=case_ids,description=description)
run_id = testrail_object.get_run_id(project_name,test_run_name)
save_new_test_run_details(os.path.join(conf_dir,'latest_test_run.txt'),test_run_name,run_id)
else:
print('Project does not exist: ',project_name)
print('Stopping the script without doing anything.')
#---START OF SCRIPT
if __name__=='__main__':
#This script takes an optional command line argument for the TestRail run id
usage = '\n----\n%prog -p <OPTIONAL: Project name> -m <OPTIONAL: milestone_name> -r <OPTIONAL: Test run name> -t <OPTIONAL: test cases conf file> -d <OPTIONAL: Test run description>\n----\nE.g.: %prog -p "Secure Code Warrior - Test" -m "Pilot NetCetera" -r commit_id -t setup_testrail.conf -d Registration\n---'
parser = OptionParser(usage=usage)
parser.add_option("-p","--project",
dest="project_name",
default="POM DEMO",
help="Project name")
parser.add_option("-m","--milestone",
dest="milestone_name",
default=None,
help="Milestone name")
parser.add_option("-r","--test_run_name",
dest="test_run_name",
default=None,
help="Test run name")
parser.add_option("-t","--test_cases_conf",
dest="test_cases_conf",
default="setup_testrail.conf",
help="Test cases conf listing test names and ids you want added")
parser.add_option("-d","--test_run_description",
dest="test_run_description",
default=None,
help="The name of the test Registration_Tests/Intro_Run_Tests/Sales_Demo_Tests")
parser.add_option("-n","--name_override_flag",
dest="name_override_flag",
default="Y",
help="Y or N. 'N' if you don't want to override the default test_run_name")
parser.add_option("-c","--case_ids_list",
dest="case_ids_list",
default=None,
help="Pass all case ids with comma separated you want to add in test run")
(options,args) = parser.parse_args()
#Run the script only if the options are valid
if check_options(options):
setup_testrail(project_name=options.project_name,
milestone_name=options.milestone_name,
test_run_name=options.test_run_name,
test_cases_conf=options.test_cases_conf,
description=options.test_run_description,
name_override_flag=options.name_override_flag,
case_ids_list=options.case_ids_list)
else:
print('ERROR: Received incorrect input arguments')
print(parser.print_usage())
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/email_util.py
|
"""
A simple IMAP util that will help us with account activation
* Connect to your imap host
* Login with username/password
* Fetch latest messages in inbox
* Get a recent registration message
* Filter based on sender and subject
* Return text of recent messages
[TO DO](not in any particular order)
1. Extend to POP3 servers
2. Add a try catch decorator
3. Enhance get_latest_email_uid to make all parameters optional
"""
#The import statements import: standard Python modules,conf
import os
import sys
import time
import imaplib
import email
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
class Email_Util:
"Class to interact with IMAP servers"
def connect(self,imap_host):
"Connect with the host"
self.mail = imaplib.IMAP4_SSL(imap_host)
return self.mail
def login(self,username,password):
"Login to the email"
result_flag = False
try:
self.mail.login(username,password)
except Exception as e:
print('\nException in Email_Util.login')
print('PYTHON SAYS:')
print(e)
print('\n')
else:
result_flag = True
return result_flag
def get_folders(self):
"Return a list of folders"
return self.mail.list()
def select_folder(self,folder):
"Select the given folder if it exists. E.g.: [Gmail]/Trash"
result_flag = False
response = self.mail.select(folder)
if response[0] == 'OK':
result_flag = True
return result_flag
def get_latest_email_uid(self,subject=None,sender=None,time_delta=10,wait_time=300):
"Search for a subject and return the latest unique ids of the emails"
uid = None
time_elapsed = 0
search_string = ''
if subject is None and sender is None:
search_string = 'ALL'
if subject is None and sender is not None:
search_string = '(FROM "{sender}")'.format(sender=sender)
if subject is not None and sender is None:
search_string = '(SUBJECT "{subject}")'.format(subject=subject)
if subject is not None and sender is not None:
search_string = '(FROM "{sender}" SUBJECT "{subject}")'.format(sender=sender,subject=subject)
print(" - Automation will be in search/wait mode for max %s seconds"%wait_time)
while (time_elapsed < wait_time and uid is None):
time.sleep(time_delta)
data = self.mail.uid('search',None,str(search_string))
if data[0].strip() != '': #Check for an empty set
uid = data[0].split()[-1]
time_elapsed += time_delta
return uid
def fetch_email_body(self,uid):
"Fetch the email body for a given uid"
email_body = []
if uid is not None:
data = self.mail.uid('fetch',uid,'(RFC822)')
raw_email = data[0][1]
email_msg = email.message_from_string(raw_email)
email_body = self.get_email_body(email_msg)
return email_body
def get_email_body(self,email_msg):
"Parse out the text of the email message. Handle multipart messages"
email_body = []
maintype = email_msg.get_content_maintype()
if maintype == 'multipart':
for part in email_msg.get_payload():
if part.get_content_maintype() == 'text':
email_body.append(part.get_payload())
elif maintype == 'text':
email_body.append(email_msg.get_payload())
return email_body
def logout(self):
"Logout"
result_flag = False
response = self.mail.logout()
if response == 'BYE':
result_flag = True
return result_flag
#---EXAMPLE USAGE---
if __name__=='__main__':
#Fetching conf details from the conf file
imap_host = os.getenv('imaphost')
username = os.getenv('app_username')
password = os.getenv('app_password')
#Initialize the email object
email_obj = Email_Util()
#Connect to the IMAP host
email_obj.connect(imap_host)
#Login
if email_obj.login(username,password):
print("PASS: Successfully logged in.")
else:
print("FAIL: Failed to login")
#Get a list of folder
folders = email_obj.get_folders()
if folders != None or []:
print("PASS: Email folders:", email_obj.get_folders())
else:
print("FAIL: Didn't get folder details")
#Select a folder
if email_obj.select_folder('Inbox'):
print("PASS: Successfully selected the folder: Inbox")
else:
print("FAIL: Failed to select the folder: Inbox")
#Get the latest email's unique id
uid = email_obj.get_latest_email_uid(wait_time=300)
if uid != None:
print("PASS: Unique id of the latest email is: ",uid)
else:
print("FAIL: Didn't get unique id of latest email")
#A. Look for an Email from provided sender, print uid and check it's contents
uid = email_obj.get_latest_email_uid(sender="Andy from Google",wait_time=300)
if uid != None:
print("PASS: Unique id of the latest email with given sender is: ",uid)
#Check the text of the latest email id
email_body = email_obj.fetch_email_body(uid)
data_flag = False
print(" - Automation checking mail contents")
for line in email_body:
line = line.replace('=','')
line = line.replace('<','')
line = line.replace('>','')
if "Hi Email_Util" and "This email was sent to you" in line:
data_flag = True
break
if data_flag == True:
print("PASS: Automation provided correct Email details. Email contents matched with provided data.")
else:
print("FAIL: Provided data not matched with Email contents. Looks like automation provided incorrect Email details")
else:
print("FAIL: After wait of 5 mins, looks like there is no email present with given sender")
#B. Look for an Email with provided subject, print uid, find Qxf2 POM address and compare with expected address
uid = email_obj.get_latest_email_uid(subject="Qxf2 Services: Public POM Link",wait_time=300)
if uid != None:
print("PASS: Unique id of the latest email with given subject is: ",uid)
#Get pom url from email body
email_body = email_obj.fetch_email_body(uid)
expected_pom_url = "https://github.com/qxf2/qxf2-page-object-model"
pom_url = None
data_flag = False
print(" - Automation checking mail contents")
for body in email_body:
search_str = "/qxf2/"
body = body.split()
for element in body:
if search_str in element:
pom_url = element
data_flag = True
break
if data_flag == True:
break
if data_flag == True and expected_pom_url == pom_url:
print("PASS: Automation provided correct mail details. Got correct Qxf2 POM url from mail body. URL: %s"%pom_url)
else:
print("FAIL: Actual POM url not matched with expected pom url. Actual URL got from email: %s"%pom_url)
else:
print("FAIL: After wait of 5 mins, looks like there is no email present with given subject")
#C. Look for an Email with provided sender and subject and print uid
uid = email_obj.get_latest_email_uid(subject="get more out of your new Google Account",sender="andy-noreply@google.com",wait_time=300)
if uid != None:
print("PASS: Unique id of the latest email with given subject and sender is: ",uid)
else:
print("FAIL: After wait of 5 mins, looks like there is no email present with given subject and sender")
#D. Look for an Email with non-existant sender and non-existant subject details
uid = email_obj.get_latest_email_uid(subject="Activate your account",sender="support@qxf2.com",wait_time=120) #you can change wait time by setting wait_time variable
if uid != None:
print("FAIL: Unique id of the latest email with non-existant subject and non-existant sender is: ",uid)
else:
print("PASS: After wait of 2 mins, looks like there is no email present with given non-existant subject and non-existant sender")
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/post_test_reports_to_slack.py
|
'''
A Simple script which used to post test reports on Slack Channel.
Steps to Use:
1. Generate Slack incoming webhook url by reffering our blog:
https://qxf2.com/blog/post-pytest-test-results-on-slack/ & add url in our code
2. Generate test report log file by adding ">log/pytest_report.log" command
at end of pytest command
for e.g. pytest -k example_form --slack_flag y -v > log/pytest_report.log
Note: Your terminal must be pointed to root address of our POM while generating
test report file using above command
3. Check you are calling correct report log file or not
'''
import os
import json
import requests
def post_reports_to_slack(timeout=30):
"Post report to Slack"
#To generate incoming webhook url ref: https://qxf2.com/blog/post-pytest-test-results-on-slack/
url= os.getenv('slack_incoming_webhook_url')
# To generate pytest_report.log file add "> log/pytest_report.log" at end of pytest command
# for e.g. pytest -k example_form --slack_flag y -v > log/pytest_report.log
# Update report file name & address here as per your requirement
test_report_file = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..','..','log','pytest_report.log'))
with open(test_report_file, "r") as in_file:
testdata = ""
for line in in_file:
testdata = testdata + '\n' + line
# Set Slack Pass Fail bar indicator color according to test results
if 'FAILED' in testdata:
bar_color = "#ff0000"
else:
bar_color = "#36a64f"
data = {"attachments":[
{"color": bar_color,
"title": "Test Report",
"text": testdata}
]}
json_params_encoded = json.dumps(data)
slack_response = requests.post(url=url,data=json_params_encoded,
headers={"Content-type":"application/json"},
timeout=timeout)
if slack_response.text == 'ok':
print('\n Successfully posted pytest report on Slack channel')
else:
print('\n Something went wrong. Unable to post pytest report on Slack channel.'
'Slack Response:', slack_response)
#---USAGE EXAMPLES
if __name__=='__main__':
post_reports_to_slack()
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/email_pytest_report.py
|
"""
Qxf2 Services: Script to send pytest test report email
* Supports both text and html formatted messages
* Supports text, html, image, audio files as an attachment
To Do:
* Provide support to add multiple attachment
Note:
* We added subject, email body message as per our need. You can update that as per your requirement.
* To generate html formatted test report, you need to use pytest-html plugin.
- To install it use command: pip install pytest-html
* To email test report with our framework use following command from the root of repo
- e.g. pytest -s -v --email_pytest_report y --html=log/pytest_report.html
* To generate pytest_report.html file use following command from the root of repo
- e.g. pytest --html = log/pytest_report.html
* To generate pytest_report.log file use following command from the root of repo
- e.g. pytest -k example_form -v > log/pytest_report.log
"""
import os
import sys
import smtplib
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.audio import MIMEAudio
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
import mimetypes
from dotenv import load_dotenv
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
load_dotenv()
class EmailPytestReport:
"Class to email pytest report"
def __init__(self):
self.smtp_ssl_host = os.getenv('smtp_ssl_host')
self.smtp_ssl_port = os.getenv('smtp_ssl_port')
self.username = os.getenv('app_username')
self.password = os.getenv('app_password')
self.sender = os.getenv('sender')
self.targets = eval(os.getenv('targets')) # pylint: disable=eval-used
def get_test_report_data(self,html_body_flag= True,report_file_path= 'default'):
'''get test report data from pytest_report.html or pytest_report.txt
or from user provided file'''
if html_body_flag == True and report_file_path == 'default':
#To generate pytest_report.html file use following command
# e.g. py.test --html = log/pytest_report.html
#Change report file name & address here
test_report_file = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..','..','log','pytest_report.html'))
elif html_body_flag == False and report_file_path == 'default':
#To generate pytest_report.log file add ">pytest_report.log" at end of py.test command
# e.g. py.test -k example_form -r F -v > log/pytest_report.log
#Change report file name & address here
test_report_file = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..','..','log','pytest_report.log'))
else:
test_report_file = report_file_path
#check file exist or not
if not os.path.exists(test_report_file):
raise Exception(f"File '{test_report_file}' does not exist. Please provide valid file")
with open(test_report_file, "r") as in_file:
testdata = ""
for line in in_file:
testdata = testdata + '\n' + line
return testdata
def get_attachment(self,attachment_file_path = 'default'):
"Get attachment and attach it to mail"
if attachment_file_path == 'default':
#To generate pytest_report.html file use following command
# e.g. py.test --html = log/pytest_report.html
#Change report file name & address here
attachment_report_file = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..','..','log','pytest_report.html'))
else:
attachment_report_file = attachment_file_path
#check file exist or not
if not os.path.exists(attachment_report_file):
raise Exception(f"File '{attachment_report_file}' does not exist.")
# Guess encoding type
ctype, encoding = mimetypes.guess_type(attachment_report_file)
if ctype is None or encoding is not None:
ctype = 'application/octet-stream' # Use a binary type as guess couldn't made
maintype, subtype = ctype.split('/', 1)
if maintype == 'text':
fp = open(attachment_report_file)
attachment = MIMEText(fp.read(), subtype)
fp.close()
elif maintype == 'image':
fp = open(attachment_report_file, 'rb')
attachment = MIMEImage(fp.read(), subtype)
fp.close()
elif maintype == 'audio':
fp = open(attachment_report_file, 'rb')
attachment = MIMEAudio(fp.read(), subtype)
fp.close()
else:
fp = open(attachment_report_file, 'rb')
attachment = MIMEBase(maintype, subtype)
attachment.set_payload(fp.read())
fp.close()
# Encode the payload using Base64
encoders.encode_base64(attachment)
# Set the filename parameter
attachment.add_header('Content-Disposition',
'attachment',
filename=os.path.basename(attachment_report_file))
return attachment
def send_test_report_email(self,html_body_flag = True,attachment_flag = False,
report_file_path = 'default'):
"send test report email"
#1. Get html formatted email body data from report_file_path file (log/pytest_report.html)
# and do not add it as an attachment
if html_body_flag == True and attachment_flag == False:
#get html formatted test report data from log/pytest_report.html
testdata = self.get_test_report_data(html_body_flag,report_file_path)
message = MIMEText(testdata,"html") # Add html formatted test data to email
#2. Get text formatted email body data from report_file_path file (log/pytest_report.log)
# and do not add it as an attachment
elif html_body_flag == False and attachment_flag == False:
#get html test report data from log/pytest_report.log
testdata = self.get_test_report_data(html_body_flag,report_file_path)
message = MIMEText(testdata) # Add text formatted test data to email
#3. Add html formatted email body message along with an attachment file
elif html_body_flag == True and attachment_flag == True:
message = MIMEMultipart()
#add html formatted body message to email
html_body = MIMEText('''<p>Hello,</p>
<p> Please check the attachment to see test built report.</p>
<p><strong>Note: For best UI experience, download the attachment and open using Chrome browser.</strong></p>
''',"html") #Update email body message here as per your requirement
message.attach(html_body)
#add attachment to email
attachment = self.get_attachment(report_file_path)
message.attach(attachment)
#4. Add text formatted email body message along with an attachment file
else:
message = MIMEMultipart()
#add test formatted body message to email
plain_text_body = MIMEText('''Hello,\n\tPlease check attachment to see test report.
\n\nNote: For best UI experience, download the attachment and
open using Chrome browser.''')#Update email body message here
message.attach(plain_text_body)
#add attachment to email
attachment = self.get_attachment(report_file_path)
message.attach(attachment)
if not self.targets or not isinstance(self.targets, list):
raise ValueError("Targets must be a non-empty list of email addresses.")
message['From'] = self.sender
message['To'] = ', '.join(self.targets)
message['Subject'] = 'Script generated test report' # Update email subject here
#Send Email
server = smtplib.SMTP_SSL(self.smtp_ssl_host, self.smtp_ssl_port)
server.login(self.username, self.password)
server.sendmail(self.sender, self.targets, message.as_string())
server.quit()
#---USAGE EXAMPLES
if __name__=='__main__':
print("Start of %s"%__file__)
#Initialize the Email_Pytest_Report object
email_obj = EmailPytestReport()
#1. Send html formatted email body message with pytest report as an attachment
# Here log/pytest_report.html is a default file.
# To generate pytest_report.html file use following command to the test
# e.g. py.test --html = log/pytest_report.html
email_obj.send_test_report_email(html_body_flag=True,attachment_flag=True,
report_file_path= 'default')
#Note: We commented below code to avoid sending multiple emails,
# you can try the other cases one by one to know more about email_pytest_report util.
'''
#2. Send html formatted pytest report
email_obj.send_test_report_email(html_body_flag=True,attachment_flag=False,
report_file_path= 'default')
#3. Send plain text formatted pytest report
email_obj.send_test_report_email(html_body_flag=False,attachment_flag=False,
report_file_path= 'default')
#4. Send plain formatted email body message with pytest reports an attachment
email_obj.send_test_report_email(html_body_flag=False,attachment_flag=True,
report_file_path='default')
#5. Send different type of attachment
# add attachment file here below:
image_file = ("C:\\Users\\Public\\Pictures\\Sample Pictures\\Koala.jpg")
email_obj.send_test_report_email(html_body_flag=False,attachment_flag=True,
report_file_path= image_file)
'''
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/gmail/__init__.py
|
"""
GMail! Woo!
"""
__title__ = 'gmail'
__version__ = '0.1'
__author__ = 'Charlie Guo'
__build__ = 0x0001
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Charlie Guo'
from .gmail import Gmail
from .mailbox import Mailbox
from .message import Message
from .exceptions import GmailException, ConnectionError, AuthenticationError
from .utils import login, authenticate
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/gmail/message.py
|
import datetime
import email
import re
import time
import os
from email.header import decode_header
class Message():
"Message class provides methods for mail functions."
def __init__(self, mailbox, uid):
self.uid = uid
self.mailbox = mailbox
self.gmail = mailbox.gmail if mailbox else None
self.message = None
self.headers = {}
self.subject = None
self.body = None
self.html = None
self.to = None
self.fr = None
self.cc = None
self.delivered_to = None
self.sent_at = None
self.flags = []
self.labels = []
self.thread_id = None
self.thread = []
self.message_id = None
self.attachments = None
def is_read(self):
return ('\\Seen' in self.flags)
def read(self):
flag = '\\Seen'
self.gmail.imap.uid('STORE', self.uid, '+FLAGS', flag)
if flag not in self.flags: self.flags.append(flag)
def unread(self):
flag = '\\Seen'
self.gmail.imap.uid('STORE', self.uid, '-FLAGS', flag)
if flag in self.flags: self.flags.remove(flag)
def is_starred(self):
return ('\\Flagged' in self.flags)
def star(self):
flag = '\\Flagged'
self.gmail.imap.uid('STORE', self.uid, '+FLAGS', flag)
if flag not in self.flags: self.flags.append(flag)
def unstar(self):
flag = '\\Flagged'
self.gmail.imap.uid('STORE', self.uid, '-FLAGS', flag)
if flag in self.flags: self.flags.remove(flag)
def is_draft(self):
return ('\\Draft' in self.flags)
def has_label(self, label):
full_label = '%s' % label
return (full_label in self.labels)
def add_label(self, label):
full_label = '%s' % label
self.gmail.imap.uid('STORE', self.uid, '+X-GM-LABELS', full_label)
if full_label not in self.labels: self.labels.append(full_label)
def remove_label(self, label):
full_label = '%s' % label
self.gmail.imap.uid('STORE', self.uid, '-X-GM-LABELS', full_label)
if full_label in self.labels: self.labels.remove(full_label)
def is_deleted(self):
return ('\\Deleted' in self.flags)
def delete(self):
flag = '\\Deleted'
self.gmail.imap.uid('STORE', self.uid, '+FLAGS', flag)
if flag not in self.flags: self.flags.append(flag)
trash = '[Gmail]/Trash' if '[Gmail]/Trash' in self.gmail.labels() else '[Gmail]/Bin'
if self.mailbox.name not in ['[Gmail]/Bin', '[Gmail]/Trash']:
self.move_to(trash)
# def undelete(self):
# flag = '\\Deleted'
# self.gmail.imap.uid('STORE', self.uid, '-FLAGS', flag)
# if flag in self.flags: self.flags.remove(flag)
def move_to(self, name):
self.gmail.copy(self.uid, name, self.mailbox.name)
if name not in ['[Gmail]/Bin', '[Gmail]/Trash']:
self.delete()
def archive(self):
self.move_to('[Gmail]/All Mail')
def parse_headers(self, message):
hdrs = {}
for hdr in message.keys():
hdrs[hdr] = message[hdr]
return hdrs
def parse_flags(self, headers):
try:
match = re.search(r'FLAGS \((.*?)\)', headers)
if match:
flags = match.group(1).split()
return flags
else:
return []
except Exception as e:
print(f"Error parsing flags: {e}")
return []
def parse_labels(self, headers):
try:
match = re.search(r'X-GM-LABELS \((.*?)\)', headers)
if match:
labels = match.group(1).split()
labels = [label.replace('"', '') for label in labels]
return labels
else:
return []
except Exception as e:
print(f"Error parsing labels: {e}")
return []
def parse_subject(self, encoded_subject):
dh = decode_header(encoded_subject)
default_charset = 'ASCII'
subject_parts = []
for part, encoding in dh:
if isinstance(part, bytes):
try:
subject_parts.append(part.decode(encoding or default_charset))
except Exception as e:
print(f"Error decoding part {part} with encoding {encoding}: {e}")
subject_parts.append(part.decode(default_charset, errors='replace'))
else:
subject_parts.append(part)
parsed_subject = ''.join(subject_parts)
return parsed_subject
def parse(self, raw_message):
raw_headers = raw_message[0]
raw_email = raw_message[1]
if isinstance(raw_headers, bytes):
raw_headers = raw_headers.decode('utf-8', errors='replace')
if isinstance(raw_email, bytes):
raw_email = raw_email.decode('utf-8', errors='replace')
if not isinstance(raw_email, str):
raise ValueError("Decoded raw_email is not a string")
try:
self.message = email.message_from_string(raw_email)
except Exception as e:
print(f"Error creating email message: {e}")
raise
self.to = self.message.get('to')
self.fr = self.message.get('from')
self.delivered_to = self.message.get('delivered_to')
self.subject = self.parse_subject(self.message.get('subject'))
if self.message.get_content_maintype() == "multipart":
for content in self.message.walk():
if content.get_content_type() == "text/plain":
self.body = content.get_payload(decode=True)
elif content.get_content_type() == "text/html":
self.html = content.get_payload(decode=True)
elif self.message.get_content_maintype() == "text":
self.body = self.message.get_payload()
self.sent_at = datetime.datetime.fromtimestamp(time.mktime(email.utils.parsedate_tz(self.message['date'])[:9]))
self.flags = self.parse_flags(raw_headers)
self.labels = self.parse_labels(raw_headers)
if re.search(r'X-GM-THRID (\d+)', raw_headers):
self.thread_id = re.search(r'X-GM-THRID (\d+)', raw_headers).groups(1)[0]
if re.search(r'X-GM-MSGID (\d+)', raw_headers):
self.message_id = re.search(r'X-GM-MSGID (\d+)', raw_headers).groups(1)[0]
self.attachments = [
Attachment(attachment) for attachment in self.message.get_payload()
if not isinstance(attachment, str) and attachment.get('Content-Disposition') is not None
]
def fetch(self):
if not self.message:
response, results = self.gmail.imap.uid('FETCH', self.uid, '(BODY.PEEK[] FLAGS X-GM-THRID X-GM-MSGID X-GM-LABELS)')
self.parse(results[0])
return self.message
# returns a list of fetched messages (both sent and received) in chronological order
def fetch_thread(self):
self.fetch()
original_mailbox = self.mailbox
self.gmail.use_mailbox(original_mailbox.name)
# fetch and cache messages from inbox or other received mailbox
response, results = self.gmail.imap.uid('SEARCH', None, '(X-GM-THRID ' + self.thread_id + ')')
received_messages = {}
uids = results[0].split(' ')
if response == 'OK':
for uid in uids: received_messages[uid] = Message(original_mailbox, uid)
self.gmail.fetch_multiple_messages(received_messages)
self.mailbox.messages.update(received_messages)
# fetch and cache messages from 'sent'
self.gmail.use_mailbox('[Gmail]/Sent Mail')
response, results = self.gmail.imap.uid('SEARCH', None, '(X-GM-THRID ' + self.thread_id + ')')
sent_messages = {}
uids = results[0].split(' ')
if response == 'OK':
for uid in uids: sent_messages[uid] = Message(self.gmail.mailboxes['[Gmail]/Sent Mail'], uid)
self.gmail.fetch_multiple_messages(sent_messages)
self.gmail.mailboxes['[Gmail]/Sent Mail'].messages.update(sent_messages)
self.gmail.use_mailbox(original_mailbox.name)
return sorted(dict(received_messages.items() + sent_messages.items()).values(), key=lambda m: m.sent_at)
class Attachment:
"Attachment class methods for email attachment."
def __init__(self, attachment):
self.name = attachment.get_filename()
# Raw file data
self.payload = attachment.get_payload(decode=True)
# Filesize in kilobytes
self.size = int(round(len(self.payload)/1000.0))
def save(self, path=None):
if path is None:
# Save as name of attachment if there is no path specified
path = self.name
elif os.path.isdir(path):
# If the path is a directory, save as name of attachment in that directory
path = os.path.join(path, self.name)
with open(path, 'wb') as f:
f.write(self.payload)
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/gmail/gmailtest.py
|
"""
This is an example automated test to check gmail utils
Our automated test will do the following:
#login to gmail and fetch mailboxes
#After fetching the mail box ,select and fetch messages and print the number of messages
#and the subject of the messages
Prerequisites:
- Gmail account with app password
"""
import sys
import os
import io
from dotenv import load_dotenv
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')))
from integrations.reporting_channels.gmail.gmail import Gmail, AuthenticationError
from integrations.reporting_channels.gmail.mailbox import Mailbox
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
load_dotenv()
def gmail_test():
"Run the Gmail utility test"
try:
# 1. Initialize Gmail object and connect
gmail = Gmail()
gmail.connect()
print("Connected to Gmail")
# 2. Login to Gmail
username = os.getenv('app_username')
password = os.getenv('app_password')
try:
gmail.login(username, password)
print("Login successful")
except AuthenticationError as e:
print(f"Authentication failed: Check for the login credentials {str(e)}")
return
# 3. Fetch mailboxes
mailboxes = gmail.fetch_mailboxes()
if mailboxes:
print(f"Fetched mailboxes: {mailboxes}")
else:
raise ValueError("Failed to fetch mailboxes!")
# 4. Select and fetch messages from SPAM mailbox
inbox_mailbox = gmail.use_mailbox("[Gmail]/Spam")
if isinstance(inbox_mailbox, Mailbox):
print("SPAM mailbox selected successfully")
else:
raise TypeError(f"Error: Expected Mailbox instance, got {type(inbox_mailbox)}")
# 5. Fetch and print messages from SPAM
messages = inbox_mailbox.mail()
print(f"Number of messages in SPAM: {len(messages)}")
# 6. Fetch and print message subjects
if messages:
msg = messages[0]
fetched_msg = msg.fetch()
print(f"Fetching Message subject: {fetched_msg.get('subject')}")
# Fetch multiple messages and log subjects
messages_dict = {msg.uid.decode('utf-8'): msg for msg in messages}
fetched_messages = gmail.fetch_multiple_messages(messages_dict)
for uid, message in fetched_messages.items():
subject = getattr(message, 'subject', 'No subject')
print(f"UID: {uid}, Subject: {subject.encode('utf-8', errors='replace').decode('utf-8')}")
else:
print("No messages found in SPAM")
# 7. Logout
gmail.logout()
print("Logged out successfully")
except Exception as e:
print(f"Exception encountered: {str(e)}")
raise
if __name__ == "__main__":
gmail_test()
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/gmail/gmail.py
|
"""
This module defines the `Gmail` class, which provides methods to interact with a Gmail account
via IMAP. The class includes functionalities to connect to the Gmail server, login using
credentials, and manage various mailboxes. Also, has functions for fetching mailboxes,
selecting a specific mailbox, searching for and retrieving emails
based on different criteria, managing labels, and handling authentication.
"""
from __future__ import absolute_import
import re
import imaplib
from integrations.reporting_channels.gmail.mailbox import Mailbox
from integrations.reporting_channels.gmail.utf import encode as encode_utf7, decode as decode_utf7
from integrations.reporting_channels.gmail.exceptions import *
class Gmail():
"Class interact with Gmail using IMAP"
# GMail IMAP defaults
GMAIL_IMAP_HOST = 'imap.gmail.com'
GMAIL_IMAP_PORT = 993
# GMail SMTP defaults
GMAIL_SMTP_HOST = "smtp.gmail.com"
GMAIL_SMTP_PORT = 587
def __init__(self):
self.username = None
self.password = None
self.access_token = None
self.imap = None
self.smtp = None
self.logged_in = False
self.mailboxes = {}
self.current_mailbox = None
# self.connect()
def connect(self, raise_errors=True):
"Establishes an IMAP connection to the Gmail server."
# try:
# self.imap = imaplib.IMAP4_SSL(self.GMAIL_IMAP_HOST, self.GMAIL_IMAP_PORT)
# except socket.error:
# if raise_errors:
# raise Exception('Connection failure.')
# self.imap = None
self.imap = imaplib.IMAP4_SSL(self.GMAIL_IMAP_HOST, self.GMAIL_IMAP_PORT)
# self.smtp = smtplib.SMTP(self.server,self.port)
# self.smtp.set_debuglevel(self.debug)
# self.smtp.ehlo()
# self.smtp.starttls()
# self.smtp.ehlo()
return self.imap
def fetch_mailboxes(self):
"Retrieves and stores the list of mailboxes available in the Gmail account."
response, mailbox_list = self.imap.list()
if response == 'OK':
mailbox_list = [item.decode('utf-8') if isinstance(item, bytes) else item for item in mailbox_list]
for mailbox in mailbox_list:
mailbox_name = mailbox.split('"/"')[-1].replace('"', '').strip()
mailbox = Mailbox(self)
mailbox.external_name = mailbox_name
self.mailboxes[mailbox_name] = mailbox
return list(self.mailboxes.keys())
else:
raise Exception("Failed to fetch mailboxes.")
def use_mailbox(self, mailbox):
"Selects a specific mailbox for further operations."
if mailbox:
self.imap.select(mailbox)
self.current_mailbox = mailbox
return Mailbox(self, mailbox)
def mailbox(self, mailbox_name):
"Returns a Mailbox object for the given mailbox name."
if mailbox_name not in self.mailboxes:
mailbox_name = encode_utf7(mailbox_name)
mailbox = self.mailboxes.get(mailbox_name)
if mailbox and not self.current_mailbox == mailbox_name:
self.use_mailbox(mailbox_name)
return mailbox
def create_mailbox(self, mailbox_name):
"Creates a new mailbox with the given name if it does not already exist."
mailbox = self.mailboxes.get(mailbox_name)
if not mailbox:
self.imap.create(mailbox_name)
mailbox = Mailbox(self, mailbox_name)
self.mailboxes[mailbox_name] = mailbox
return mailbox
def delete_mailbox(self, mailbox_name):
"Deletes the specified mailbox and removes it from the cache."
mailbox = self.mailboxes.get(mailbox_name)
if mailbox:
self.imap.delete(mailbox_name)
del self.mailboxes[mailbox_name]
def login(self, username, password):
"Login to Gmail using the provided username and password. "
self.username = username
self.password = password
if not self.imap:
self.connect()
try:
imap_login = self.imap.login(self.username, self.password)
self.logged_in = (imap_login and imap_login[0] == 'OK')
if self.logged_in:
self.fetch_mailboxes()
except imaplib.IMAP4.error:
raise AuthenticationError
return self.logged_in
def authenticate(self, username, access_token):
"Login to Gmail using OAuth2 with the provided username and access token."
self.username = username
self.access_token = access_token
if not self.imap:
self.connect()
try:
auth_string = 'user=%s\1auth=Bearer %s\1\1' % (username, access_token)
imap_auth = self.imap.authenticate('XOAUTH2', lambda x: auth_string)
self.logged_in = (imap_auth and imap_auth[0] == 'OK')
if self.logged_in:
self.fetch_mailboxes()
except imaplib.IMAP4.error:
raise AuthenticationError
return self.logged_in
def logout(self):
"Logout from the Gmail account and closes the IMAP connection."
self.imap.logout()
self.logged_in = False
def label(self, label_name):
"Retrieves a Mailbox object for the specified label (mailbox)."
return self.mailbox(label_name)
def find(self, mailbox_name="[Gmail]/All Mail", **kwargs):
"Searches and returns emails based on the provided search criteria."
box = self.mailbox(mailbox_name)
return box.mail(**kwargs)
def copy(self, uid, to_mailbox, from_mailbox=None):
"Copies an email with the given UID from one mailbox to another."
if from_mailbox:
self.use_mailbox(from_mailbox)
self.imap.uid('COPY', uid, to_mailbox)
def fetch_multiple_messages(self, messages):
"Fetches and parses multiple messages given a dictionary of `Message` objects."
if not isinstance(messages, dict):
raise Exception('Messages must be a dictionary')
fetch_str = ','.join(messages.keys())
response, results = self.imap.uid('FETCH', fetch_str, '(BODY.PEEK[] FLAGS X-GM-THRID X-GM-MSGID X-GM-LABELS)')
for raw_message in results:
if isinstance(raw_message, tuple):
uid_match = re.search(rb'UID (\d+)', raw_message[0])
if uid_match:
uid = uid_match.group(1).decode('utf-8')
if uid in messages:
messages[uid].parse(raw_message)
return messages
def labels(self, require_unicode=False):
"Returns a list of all available mailbox names."
keys = self.mailboxes.keys()
if require_unicode:
keys = [decode_utf7(key) for key in keys]
return keys
def inbox(self):
"Returns a `Mailbox` object for the Inbox."
return self.mailbox("INBOX")
def spam(self):
"Returns a `Mailbox` object for the Spam."
return self.mailbox("[Gmail]/Spam")
def starred(self):
"Returns a `Mailbox` object for the starred folder."
return self.mailbox("[Gmail]/Starred")
def all_mail(self):
"Returns a `Mailbox` object for the All mail."
return self.mailbox("[Gmail]/All Mail")
def sent_mail(self):
"Returns a `Mailbox` object for the Sent mail."
return self.mailbox("[Gmail]/Sent Mail")
def important(self):
"Returns a `Mailbox` object for the Important."
return self.mailbox("[Gmail]/Important")
def mail_domain(self):
"Returns the domain part of the logged-in email address"
return self.username.split('@')[-1]
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/gmail/utils.py
|
from .gmail import Gmail
def login(username, password):
gmail = Gmail()
gmail.login(username, password)
return gmail
def authenticate(username, access_token):
gmail = Gmail()
gmail.authenticate(username, access_token)
return gmail
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/gmail/mailbox.py
|
"""
This module defines the `Mailbox` class, which represents a mailbox in a Gmail account.
The class provides methods to interact with the mailbox, including searching for emails
based on various criteria, fetching email threads, counting emails, and managing cached
messages.
"""
import re
from .message import Message
from .utf import encode as encode_utf7, decode as decode_utf7
class Mailbox():
"Mailbox class provides methods for email operations."
def __init__(self, gmail, name="INBOX"):
self.name = name
self.gmail = gmail
self.date_format = "%d-%b-%Y"
self.messages = {}
@property
def external_name(self):
"Encodes the name to IMAP modified UTF-7 format."
if "external_name" not in vars(self):
vars(self)["external_name"] = encode_utf7(self.name)
return vars(self)["external_name"]
@external_name.setter
def external_name(self, value):
"Decodes and sets the mailbox name from IMAP modified UTF-7 format."
if "external_name" in vars(self):
del vars(self)["external_name"]
self.name = decode_utf7(value)
def mail(self, prefetch=False, **kwargs):
"Searches and returns a list of emails matching the specified search criteria."
search = ['ALL']
if kwargs.get('read'):
search.append('SEEN')
if kwargs.get('unread'):
search.append('UNSEEN')
if kwargs.get('starred'):
search.append('FLAGGED')
if kwargs.get('unstarred'):
search.append('UNFLAGGED')
if kwargs.get('deleted'):
search.append('DELETED')
if kwargs.get('undeleted'):
search.append('UNDELETED')
if kwargs.get('draft'):
search.append('DRAFT')
if kwargs.get('undraft'):
search.append('UNDRAFT')
if kwargs.get('before'):
search.extend(['BEFORE', kwargs.get('before').strftime(self.date_format)])
if kwargs.get('after'):
search.extend(['SINCE', kwargs.get('after').strftime(self.date_format)])
if kwargs.get('on'):
search.extend(['ON', kwargs.get('on').strftime(self.date_format)])
if kwargs.get('header'):
search.extend(['HEADER', kwargs.get('header')[0], kwargs.get('header')[1]])
if kwargs.get('sender'):
search.extend(['FROM', kwargs.get('sender')])
if kwargs.get('fr'):
search.extend(['FROM', kwargs.get('fr')])
if kwargs.get('to'):
search.extend(['TO', kwargs.get('to')])
if kwargs.get('cc'):
search.extend(['CC', kwargs.get('cc')])
if kwargs.get('subject'):
search.extend(['SUBJECT', kwargs.get('subject')])
if kwargs.get('body'):
search.extend(['BODY', kwargs.get('body')])
if kwargs.get('label'):
search.extend(['X-GM-LABELS', kwargs.get('label')])
if kwargs.get('attachment'):
search.extend(['HAS', 'attachment'])
if kwargs.get('query'):
search.extend([kwargs.get('query')])
emails = []
search_criteria = ' '.join(search).encode('utf-8')
response, data = self.gmail.imap.uid('SEARCH', None, search_criteria)
if response == 'OK':
uids = filter(None, data[0].split(b' ')) # filter out empty strings
for uid in uids:
if not self.messages.get(uid):
self.messages[uid] = Message(self, uid)
emails.append(self.messages[uid])
if prefetch and emails:
messages_dict = {}
for email in emails:
messages_dict[email.uid] = email
self.messages.update(self.gmail.fetch_multiple_messages(messages_dict))
return emails
# WORK IN PROGRESS. NOT FOR ACTUAL USE
def threads(self, prefetch=False):
"Fetches email threads from the mailbox."
emails = []
response, data = self.gmail.imap.uid('SEARCH', None, 'ALL'.encode('utf-8'))
if response == 'OK':
uids = data[0].split(b' ')
for uid in uids:
if not self.messages.get(uid):
self.messages[uid] = Message(self, uid)
emails.append(self.messages[uid])
if prefetch:
fetch_str = ','.join(uids).encode('utf-8')
response, results = self.gmail.imap.uid('FETCH', fetch_str,
'(BODY.PEEK[] FLAGS X-GM-THRID X-GM-MSGID X-GM-LABELS)')
for index in range(len(results) - 1):
raw_message = results[index]
if re.search(rb'UID (\d+)', raw_message[0]):
uid = re.search(rb'UID (\d+)', raw_message[0]).groups(1)[0]
self.messages[uid].parse(raw_message)
return emails
def count(self, **kwargs):
"Returns the length of emails matching the specified search criteria."
return len(self.mail(**kwargs))
def cached_messages(self):
"Returns a dictionary of cached messages in the mailbox"
return self.messages
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/gmail/exceptions.py
|
# -*- coding: utf-8 -*-
"""
gmail.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Gmails' exceptions.
"""
class GmailException(RuntimeError):
"""There was an ambiguous exception that occurred while handling your
request."""
class ConnectionError(GmailException):
"""A Connection error occurred."""
class AuthenticationError(GmailException):
"""Gmail Authentication failed."""
class Timeout(GmailException):
"""The request timed out."""
| 0 |
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels
|
qxf2_public_repos/acc-model-app/tests/integrations/reporting_channels/gmail/utf.py
|
"""
# The contents of this file has been derived code from the Twisted project
# (http://twistedmatrix.com/). The original author is Jp Calderone.
# Twisted project license follows:
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
TEXT_TYPE = str
BINARY_TYPE = bytes
PRINTABLE = set(range(0x20, 0x26)) | set(range(0x27, 0x7f))
def encode(s):
"""Encode a folder name using IMAP modified UTF-7 encoding.
Despite the function's name, the output is still a unicode string.
"""
if not isinstance(s, TEXT_TYPE):
return s
r = []
_in = []
def extend_result_if_chars_buffered():
if _in:
r.extend(['&', modified_utf7(''.join(_in)), '-'])
del _in[:]
for c in s:
if ord(c) in PRINTABLE:
extend_result_if_chars_buffered()
r.append(c)
elif c == '&':
extend_result_if_chars_buffered()
r.append('&-')
else:
_in.append(c)
extend_result_if_chars_buffered()
return ''.join(r)
def decode(s):
"""Decode a folder name from IMAP modified UTF-7 encoding to unicode.
Despite the function's name, the input may still be a unicode
string. If the input is bytes, it's first decoded to unicode.
"""
if isinstance(s, BINARY_TYPE):
s = s.decode('latin-1')
if not isinstance(s, TEXT_TYPE):
return s
r = []
_in = []
for c in s:
if c == '&' and not _in:
_in.append('&')
elif c == '-' and _in:
if len(_in) == 1:
r.append('&')
else:
r.append(modified_deutf7(''.join(_in[1:])))
_in = []
elif _in:
_in.append(c)
else:
r.append(c)
if _in:
r.append(modified_deutf7(''.join(_in[1:])))
return ''.join(r)
def modified_utf7(s):
"Convert a string to modified UTF-7 encoding."
# encode to utf-7: '\xff' => b'+AP8-', decode from latin-1 => '+AP8-'
s_utf7 = s.encode('utf-7').decode('latin-1')
return s_utf7[1:-1].replace('/', ',')
def modified_deutf7(s):
"Convert a modified UTF-7 encoded string back to UTF-8."
s_utf7 = '+' + s.replace(',', '/') + '-'
# encode to latin-1: '+AP8-' => b'+AP8-', decode from utf-7 => '\xff'
return s_utf7.encode('latin-1').decode('utf-7')
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/page_objects/zero_page.py
|
"""
This class models the first dummy page needed by the framework to start.
URL: None
Please do not modify or delete this page
"""
from core_helpers.web_app_helper import Web_App_Helper
class Zero_Page(Web_App_Helper):
"Page Object for the dummy page"
def start(self):
"Use this method to go to specific URL -- if needed"
pass
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/page_objects/PageFactory.py
|
"""
PageFactory uses the factory design pattern.
get_page_object() returns the appropriate page object.
Add elif clauses as and when you implement new pages.
Pages implemented so far:
1. Tutorial main page
2. Tutorial redirect page
3. Contact Page
4. Bitcoin main page
5. Bitcoin price page
"""
# pylint: disable=import-outside-toplevel, E0401
from conf import base_url_conf as url_conf
class PageFactory():
"PageFactory uses the factory design pattern."
@staticmethod
def get_page_object(page_name,base_url=url_conf.ui_base_url):
"Return the appropriate page object based on page_name"
test_obj = None
page_name = page_name.lower()
if page_name in ["zero","zero page","agent zero"]:
from page_objects.zero_page import Zero_Page
test_obj = Zero_Page(base_url=base_url)
elif page_name in ["zero mobile","zero mobile page"]:
from page_objects.zero_mobile_page import Zero_Mobile_Page
test_obj = Zero_Mobile_Page()
elif page_name == "main page":
from page_objects.examples.selenium_tutorial_webpage.tutorial_main_page import Tutorial_Main_Page
test_obj = Tutorial_Main_Page(base_url=base_url)
elif page_name == "redirect":
from page_objects.examples.selenium_tutorial_webpage.tutorial_redirect_page import Tutorial_Redirect_Page
test_obj = Tutorial_Redirect_Page(base_url=base_url)
elif page_name == "contact page":
from page_objects.examples.selenium_tutorial_webpage.contact_page import Contact_Page
test_obj = Contact_Page(base_url=base_url)
elif page_name == "bitcoin main page":
from page_objects.examples.bitcoin_mobile_app.bitcoin_main_page import Bitcoin_Main_Page
test_obj = Bitcoin_Main_Page()
elif page_name == "bitcoin price page":
from page_objects.examples.bitcoin_mobile_app.bitcoin_price_page import Bitcoin_Price_Page
test_obj = Bitcoin_Price_Page()
#"New pages added needs to be updated in the get_all_page_names method too"
elif page_name == "weathershopper home page":
from page_objects.examples.weather_shopper_mobile_app.weather_shopper_home_page import WeatherShopperHomePage
test_obj = WeatherShopperHomePage()
elif page_name == "weathershopper products page":
from page_objects.examples.weather_shopper_mobile_app.weather_shopper_product_page import WeatherShopperProductPage
test_obj = WeatherShopperProductPage()
elif page_name == "weathershopper payment page":
from page_objects.examples.weather_shopper_mobile_app.weather_shopper_payment_page import WeatherShopperPaymentPage
test_obj = WeatherShopperPaymentPage()
elif page_name == "weathershopper cart page":
from page_objects.examples.weather_shopper_mobile_app.weather_shopper_cart_page import WeatherShopperCartPage
test_obj = WeatherShopperCartPage()
elif page_name == "webview":
from page_objects.examples.weather_shopper_mobile_app.webview_chrome import WebviewChrome
test_obj = WebviewChrome()
return test_obj
@staticmethod
def get_all_page_names():
"Return the page names"
return ["main page",
"redirect",
"contact page"]
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/page_objects/zero_mobile_page.py
|
"""
This class models the first dummy page needed by the framework to start.
URL: None
Please do not modify or delete this page
"""
from core_helpers.mobile_app_helper import Mobile_App_Helper
class Zero_Mobile_Page(Mobile_App_Helper):
"Page Object for the dummy page"
def start(self):
"Use this method to go to specific URL -- if needed"
pass
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/api_acc_model_conf.py
|
"""
Configuration for creating ACC models, attributes, components, and capabilities.
"""
# pylint: disable=invalid-name
import time
import os
import random
# Constant for current timestamp
current_timestamp = str(int(time.time()))
# Bearer token from environment variables
bearer_token = os.environ.get('bearer_token')
invalid_bearer_token = "invalid_bearer_token"
# ACC model details and attribute details
acc_details = {'name': 'Newsletter App' ,
'description': 'Creating an acc model name for newsletter app'}
attribute_details = {'name': 'Secure' ,
'description': 'Creating an attribute for newsletter app'}
capability_details = {'name': 'Edit articles' ,
'description': 'Edit an added article'}
# Rating details
rating_details = [
"Stable",
"Acceptable",
"Low Impact",
"Critical concern",
"Not applicable"
]
rating_options = random.choice(rating_details)
# Create multiple ACC models
acc_models_name = "Survey app"
acc_models_description = "Creating an ACC model name for survey app"
num_models = 3
# Create multiple attributes
attributes_name = "Fast"
attributes_description = "Creating an attribute for survey app"
num_attributes = 3
# Create multiple components
components_name = "Manage articles"
components_description = "Creating a component for newsletter app"
num_components = 3
# Create capability
capability_name = 'Add articles'
capability_description = 'Adding new articles for newsletter'
# Create multiple capabilities
multiple_capabilities = [
{"name": "Registration", "description": "Handles user registration"},
{"name": "Login", "description": "Handles user login"},
{"name": "User Profile", "description": "Allows users to manage their profiles"}
]
# Components configuration for dynamic creation
components = [
{"name": "Authentication module", "description": "Handles user authentication"},
{"name": "User management module", "description": "Manages user profiles and roles"},
{"name": "Notification module", "description": "Sends user notifications and alerts"}
]
# Mapping components to specific capabilities
capabilities = {
"Authentication module": [
{"name": "Registration", "description": "Handles user registration"},
{"name": "Login", "description": "Handles user login"}
],
"User management module": [
{"name": "User Profile", "description": "Allows users to manage their profiles"},
{"name": "Role Management", "description": "Manages user roles and permissions"}
],
"Notification module": [
{"name": "Email Notifications", "description": "Sends email notifications to users"},
{"name": "Push Notifications", "description": "Sends push notifications to users"}
]
}
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/clean_up_repo_conf.py
|
"""
The file will have relative paths for dir and respective files which clean_up_repo.py will delete.
"""
import os
# Declaring directories as directory list
# dir_list : list
REPO_DIR = os.path.dirname(os.path.dirname(__file__))
CONF_DIR = os.path.join(REPO_DIR, 'conf')
ENDPOINTS_DIR = os.path.join(REPO_DIR, 'endpoints')
PAGE_OBJECTS_EXAMPLES_DIR = os.path.join(REPO_DIR, 'page_objects','examples')
TEST_DIR = os.path.join(REPO_DIR, 'tests')
dir_list = [CONF_DIR, ENDPOINTS_DIR, TEST_DIR]
# Declaring files as file_list
# file_list : list
CONF_FILES_DELETE = ['api_example_conf.py',
'example_form_conf.py',
'example_table_conf.py',
'mobile_bitcoin_conf.py',
'successive_form_creation_conf.py']
ENDPOINTS_FILES_DELETE = ['Cars_API_Endpoints.py',
'Registration_API_Endpoints.py',
'User_API_Endpoints.py']
TEST_FILES_DELETE = ['test_example_table.py',
'test_api_example.py',
'test_mobile_bitcoin_price.py',
'test_successive_form_creation.py',
'test_example_form.py',
'test_accessibility.py']
file_list = [CONF_FILES_DELETE, ENDPOINTS_FILES_DELETE, TEST_FILES_DELETE]
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/testrail_caseid_conf.py
|
"""
Conf file to hold the testcase id
"""
test_example_form = 125
test_example_table = 126
test_example_form_name = 127
test_example_form_email = 128
test_example_form_phone = 129
test_example_form_gender = 130
test_example_form_footer_contact = 131
test_bitcoin_price_page_header = 234
test_bitcoin_real_time_price = 235
test_successive_form_creation = 132
test_accessibility = 140
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/remote_url_conf.py
|
#The URLs for connecting to BrowserStack and Sauce Labs.
browserstack_url = "http://hub-cloud.browserstack.com/wd/hub"
browserstack_app_upload_url = "https://api-cloud.browserstack.com/app-automate/upload"
browserstack_api_server_url = "https://api.browserstack.com/automate"
browserstack_cloud_api_server_url = "https://api-cloud.browserstack.com"
saucelabs_url = "https://ondemand.eu-central-1.saucelabs.com:443/wd/hub"
saucelabs_app_upload_url = 'https://api.eu-central-1.saucelabs.com/v1/storage/upload'
lambdatest_url = "http://{}:{}@hub.lambdatest.com/wd/hub"
lambdatest_api_server_url = "https://api.lambdatest.com/automation/api/v1"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/snapshot_dir_conf.py
|
"""
Conf file for snapshot directory
"""
import os
snapshot_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),'tests', 'snapshots', 'test_accessibility', 'test_accessibility', 'chrome')
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/ports_conf.py
|
"""
Specify the port in which you want to run your local mobile tests
"""
port = 4723
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/screenshot_conf.py
|
BS_ENABLE_SCREENSHOTS = False
overwrite_flag = False
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/gpt_summarization_prompt.py
|
summarization_prompt = """
You are a helpful assistant who specializes in providing technical solutions or recommendations to errors in Python. You will receive the contents of a consolidated log file containing results of automation tests run using Pytest. These tests were conducted using a Python Selenium framework.
Carefully analyze the contents of the log file and summarize the results focussing on providing technical recommendations for any errors encountered. Provide the response in JSON format. Follow the below instructions:
- Start with a heading that says "SummaryOfTestResults".
- Use the "PassedTests" key to list the names of the tests that have passed along with the number of checks passed within each test. In the log file, for each test, check for the presence of information regarding the total number of checks and the number of checks passed. If this information is present, extract the number of checks passed and include it in the summary by indicating the test name followed by the number of checks passed, separated by a colon. Avoid providing detailed information about individual checks and about mini-checks too.
- Use the "FailedTests" key to list the names of the failed tests.
- For each failed test, provide the following information:
- Use the "test_name" key to indicate the name of the failed test.
- Use the "reasons_for_failure" key to provide the specific failure message encountered during the test execution. This should include the error message or relevant failure information. Look for messages categorized as DEBUG, ERROR, or CRITICAL to extract the reasons for failure.
- Use the "recommendations" key to provide suggestions on how to fix the errors encountered for that test. The recommendations should be based on the failures listed in the "reasons_for_failure" key, ensuring that the suggestions are contextually relevant to the specific issues identified during the test execution.
- Do not give general recommendations to improve tests.
- Exclude any information related to assertion errors, and do not provide recommendations specific to assertion failures.
- Before providing recommendations, review the list of predefined reasons_for_failure outlined below. While analyzing the log file, if any of these predefined reasons_for_failure are encountered, include the corresponding recommendations provided for that specific failure.
- List of reasons_for_failure:
1. reasons_for_failure:
* Browser console error on url
* Failed to load resource: the server responded with a status of 404 ()
recommendations:
* Verify the URL and check for typos.
* Ensure the requested resource exists on the server or hasn't been moved/deleted.
2. reasons_for_failure:
* Multiple or all locators of test has 'no such element: Unable to locate element:' error.
recommendations:
* Verify the URL and check for typos.
* Review for any recent changes in the web page that could affect element visibility.
3. reasons_for_failure:
* 'Unknown error: net::ERR_NAME_NOT_RESOLVED' error for all tests
recommendations:
* Check if the base URL is correct.
* Ensure that the hostname is resolvable.
* Check for network issues or DNS problems that might be preventing the browser from resolving the domain name.
4. reasons_for_failure:
* Browser driver executable needs to be in PATH.
recommendations:
* Ensure that the executable for the specific browser driver (eg. 'chromedriver', 'geckodriver' etc.) is installed and its location is added to the system PATH.
The response should be in JSON format like this:
"""
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/locators_conf.py
|
#Common locator file for all locators
#Locators are ordered alphabetically
############################################
#Selectors we can use
#ID
#NAME
#css selector
#CLASS_NAME
#LINK_TEXT
#PARTIAL_LINK_TEXT
#XPATH
###########################################
#Locators for the footer object(footer_object.py)
footer_menu = "xpath,//ul[contains(@class,'nav-justified')]/descendant::a[text()='%s']"
copyright_text = "xpath,//p[contains(@class,'qxf2_copyright')]"
#----
#Locators for the form object(form_object.py)
name_field = "id,name"
email_field = "name,email"
phone_no_field = "css selector,#phone"
click_me_button = "xpath,//button[text()='Click me!']"
gender_dropdown = "xpath,//button[@data-toggle='dropdown']"
gender_option = "xpath,//a[text()='%s']"
tac_checkbox = "xpath,//input[@type='checkbox']"
#----
#Locators for hamburger menu object(hamburg_menu_object.py)
menu_icon = "xpath,//img[@alt='Menu']"
menu_link = "xpath,//ul[contains(@class,'dropdown-menu')]/descendant::a[text()='%s']"
menu_item = "xpath,//ul[contains(@class,'dropdown-menu')]/descendant::a[@data-toggle='dropdown' and text()='%s']"
#----
#Locators for header object(header_object.py)
qxf2_logo = "xpath,//img[contains(@src,'qxf2_logo.png')]"
qxf2_tagline_part1 = "xpath,//h1[contains(@class,'banner-brown') and text()='SOFTWARE TESTING SERVICES']"
qxf2_tagline_part2 = "xpath,//h1[contains(@class,'banner-grey') and text()='for startups']"
#----
#Locators for table object(table_object.py)
table_xpath = "xpath,//table[@name='Example Table']"
rows_xpath = "xpath,//table[@name='Example Table']//tbody/descendant::tr"
cols_xpath = "xpath,//table[@name='Example Table']//tbody/descendant::td"
cols_relative_xpath = "xpath,//table[@name='Example Table']//tbody/descendant::tr[%d]/descendant::td"
cols_header = "xpath,//table[@name='Example Table']//thead/descendant::th"
#----
#Locators for tutorial redirect page(tutorial_redirect_page.py)
heading = "xpath,//h2[contains(@class,'grey_text') and text()='Selenium for beginners: Practice page 2']"
#Locators for Contact Object(contact_object.py)
contact_name_field = "id,name"
#Locators for mobile application - Bitcoin Info(bitcoin_price_page.py)
bitcoin_real_time_price_button = "xpath,//android.widget.TextView[@resource-id='com.dudam.rohan.bitcoininfo:id/current_price']"
bitcoin_price_page_heading = "xpath,//android.widget.TextView[@text='Real Time Price of Bitcoin']"
bitcoin_price_in_usd = "xpath,//android.widget.TextView[@resource-id='com.dudam.rohan.bitcoininfo:id/doller_value']"
#Weather Shopper
temperature = "id,textHome"
moisturizers = "xpath,//android.widget.TextView[@text='Moisturizers']"
sunscreens = "xpath,//android.widget.TextView[@text='Sunscreens']"
cart = "xpath,//android.widget.TextView[@text='Cart']"
recycler_view = "id,recyclerView"
product_price = "id,text_product_price"
product_name = "id,text_product_name"
add_to_cart = "xpath,//android.widget.TextView[@text='{}']/parent::*/android.widget.Button[@text='ADD TO CART']"
total_amount = "id,totalAmountTextView"
edit_quantity = "xpath,//android.widget.TextView[@text='{}']/following-sibling::android.widget.LinearLayout/android.widget.EditText"
refresh_button = "id,refreshButton"
checkbox = "xpath,//android.widget.TextView[@text='{}']/ancestor::android.widget.LinearLayout/preceding-sibling::android.widget.CheckBox"
delete_from_cart_button = "id,deleteSelectedButton"
checkout_button = "id,checkoutButton"
payment_method_dropdown = "id,payment_method_spinner"
payment_card_type = "xpath,//android.widget.CheckedTextView[@text='{}']"
payment_email = "id,email_edit_text"
payment_card_number = "id,card_number_edit_text"
payment_card_expiry = "id,expiration_date_edit_text"
payment_card_cvv = "id,cvv_edit_text"
pay_button = "id,pay_button"
payment_success = "xpath,//android.widget.TextView[@text='Payment Successful']"
image_of_moisturizer = "xpath,//android.widget.TextView[@text='Wilhelm Aloe Hydration Lotion']/parent::*/android.widget.ImageView"
image_of_sunscreen = "xpath,//android.widget.TextView[@text='Robert Herbals Sunblock SPF-40']/parent::*/android.widget.ImageView"
menu_option = "xpath,//android.widget.ImageView[@content-desc='More options']"
developed_by = "xpath,//android.widget.TextView[@text='Developed by Qxf2 Services']"
about_app = "xpath,//android.widget.TextView[@text='About This App']"
framework = "xpath,//android.widget.TextView[@text='Qxf2 Automation Framework']"
privacy_policy = "xpath,//android.widget.TextView[@text='Privacy Policy']"
contact_us = "xpath,//android.widget.TextView[@text='Contact us']"
chrome_welcome_dismiss = "xpath,//android.widget.Button[@resource-id='com.android.chrome:id/signin_fre_dismiss_button']"
turn_off_sync_button = "xpath,//android.widget.Button[@resource-id='com.android.chrome:id/negative_button']"
image_of_moisturizer = "xpath,//android.widget.TextView[@text='Wilhelm Aloe Hydration Lotion']/parent::*/android.widget.ImageView"
image_of_sunscreen = "xpath,//android.widget.TextView[@text='Robert Herbals Sunblock SPF-40']/parent::*/android.widget.ImageView"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/copy_framework_template_conf.py
|
"""
This conf file would have the relative paths of the files & folders.
"""
import os
#Files from src:
src_file1 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','__init__.py'))
src_file2 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','conftest.py'))
src_file3 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','Readme.md'))
src_file4 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','requirements.txt'))
src_file5 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','.gitignore'))
src_file6 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','env_conf'))
src_file7 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','env_remote'))
src_file8 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','env_ssh_conf'))
src_file9 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','pytest.ini'))
#src file list:
src_files_list = [src_file1,src_file2,src_file3,src_file4,src_file5,src_file6,src_file7,src_file8,
src_file9]
#CONF
#files from src conf:
src_conf_file1 = os.path.abspath(os.path.join(os.path.dirname(__file__),'testrail_caseid_conf.py'))
src_conf_file2 = os.path.abspath(os.path.join(os.path.dirname(__file__),'base_url_conf.py'))
src_conf_file3 = os.path.abspath(os.path.join(os.path.dirname(__file__),'browser_os_name_conf.py'))
src_conf_file4 = os.path.abspath(os.path.join(os.path.dirname(__file__),'clean_up_repo_conf.py'))
src_conf_file5 = os.path.abspath(os.path.join(os.path.dirname(__file__),'gpt_summarization_prompt.py'))
src_conf_file6 = os.path.abspath(os.path.join(os.path.dirname(__file__),'locators_conf.py'))
src_conf_file7 = os.path.abspath(os.path.join(os.path.dirname(__file__),'ports_conf.py'))
src_conf_file8 = os.path.abspath(os.path.join(os.path.dirname(__file__),'remote_url_conf.py'))
src_conf_file9 = os.path.abspath(os.path.join(os.path.dirname(__file__),'screenshot_conf.py'))
src_conf_file10 = os.path.abspath(os.path.join(os.path.dirname(__file__),'snapshot_dir_conf.py'))
src_conf_file11 = os.path.abspath(os.path.join(os.path.dirname(__file__),'__init__.py'))
#src Conf file list:
src_conf_files_list = [src_conf_file1,src_conf_file2,src_conf_file3,src_conf_file4,src_conf_file5,
src_conf_file6,src_conf_file7,src_conf_file8,src_conf_file9,src_conf_file10,
src_conf_file11]
#Page_Objects
#files from src page_objects:
src_page_objects_file1 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','page_objects','zero_page.py'))
src_page_objects_file2 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','page_objects','zero_mobile_page.py'))
src_page_objects_file3 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','page_objects','PageFactory.py'))
src_page_objects_file4 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','page_objects','__init__.py'))
#src page_objects file list:
src_page_objects_files_list = [src_page_objects_file1,src_page_objects_file2,src_page_objects_file3,src_page_objects_file4]
#tests
#files from tests:
src_tests_file1 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','tests','__init__.py'))
src_tests_file2 = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','tests','test_boilerplate.py'))
#src tests file list:
src_tests_files_list = [src_tests_file1, src_tests_file2]
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/base_url_conf.py
|
"""
Conf file for base_url
"""
ui_base_url = "add_ui_test_url"
api_base_url= "http://127.0.0.1:8000"
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/conf/browser_os_name_conf.py
|
"""
Conf file to generate the cross browser cross platform test run configuration
"""
import os
#Conf list for local
default_browser = ["chrome"] #default browser for the tests to run against when -B option is not used
local_browsers = ["firefox","chrome"] #local browser list against which tests would run if no -M Y and -B all is used
#Conf list for Browserstack/Sauce Labs
#change this depending on your client
browsers = ["firefox","chrome","safari"] #browsers to generate test run configuration to run on Browserstack/Sauce Labs
firefox_versions = ["121","122"] #firefox versions for the tests to run against on Browserstack/Sauce Labs
chrome_versions = ["121","122"] #chrome versions for the tests to run against on Browserstack/Sauce Labs
safari_versions = ["15.3"] #safari versions for the tests to run against on Browserstack/Sauce Labs
os_list = ["windows","OS X"] #list of os for the tests to run against on Browserstack/Sauce Labs
windows_versions = ["10","11"] #list of windows versions for the tests to run against on Browserstack/Sauce Labs
os_x_versions = ["Monterey"] #list of os x versions for the tests to run against on Browserstack/Sauce Labs
sauce_labs_os_x_versions = ["10.10"] #Set if running on sauce_labs instead of "yosemite"
default_config_list = [("chrome","latest","windows","11")] #default configuration against which the test would run if no -B all option is used
# Define default os versions based on os
default_os_versions = {
"windows": "11",
"os x": "sequoia"
}
def generate_configuration(browsers=browsers,firefox_versions=firefox_versions,chrome_versions=chrome_versions,safari_versions=safari_versions,
os_list=os_list,windows_versions=windows_versions,os_x_versions=os_x_versions):
"Generate test configuration"
if os.getenv('REMOTE_BROWSER_PLATFORM') == 'SL':
os_x_versions = sauce_labs_os_x_versions
test_config = []
for browser in browsers:
if browser == "firefox":
for firefox_version in firefox_versions:
for os_name in os_list:
if os_name == "windows":
for windows_version in windows_versions:
config = [browser,firefox_version,os_name,windows_version]
test_config.append(tuple(config))
if os_name == "OS X":
for os_x_version in os_x_versions:
config = [browser,firefox_version,os_name,os_x_version]
test_config.append(tuple(config))
if browser == "chrome":
for chrome_version in chrome_versions:
for os_name in os_list:
if os_name == "windows":
for windows_version in windows_versions:
config = [browser,chrome_version,os_name,windows_version]
test_config.append(tuple(config))
if os_name == "OS X":
for os_x_version in os_x_versions:
config = [browser,chrome_version,os_name,os_x_version]
test_config.append(tuple(config))
if browser == "safari":
for safari_version in safari_versions:
for os_name in os_list:
if os_name == "OS X":
for os_x_version in os_x_versions:
config = [browser,safari_version,os_name,os_x_version]
test_config.append(tuple(config))
return test_config
#variable to hold the configuration that can be imported in the conftest.py file
cross_browser_cross_platform_config = generate_configuration()
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/core_helpers/custom_pytest_plugins.py
|
"""
This module houses custom pytest plugins implemented
Plugins added:
- CustomTerminalReporter: Print a prettytable failure summary using pytest
"""
from _pytest.terminal import TerminalReporter
from .prettytable_object import FailureSummaryTable # pylint: disable=relative-beyond-top-level
class CustomTerminalReporter(TerminalReporter): # pylint: disable=subclassed-final-class
"A custom pytest TerminalReporter plugin"
def __init__(self, config):
self.failed_scenarios = {}
super().__init__(config)
# Overwrite the summary_failures method to print the prettytable summary
def summary_failures(self):
if self.failed_scenarios:
table = FailureSummaryTable()
# Print header
self.write_sep(sep="=", title="Failure Summary", red=True)
# Print table
table.print_table(self.failed_scenarios)
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/core_helpers/prettytable_object.py
|
"""
A module to house prettytable custom objects
This tail made objects are used by pytest to print table output of failure summary
"""
from prettytable.colortable import ColorTable, Theme, Themes
#pylint: disable=too-few-public-methods
class PrettyTableTheme(Themes):
"A custom color theme object"
Failure = Theme(default_color="31",
vertical_color="31",
horizontal_color="31",
junction_color="31")
class FailureSummaryTable():
"Failure Summary Table to be printed in the pytest result summary"
def __init__(self) -> None:
"""
Initializer
"""
# Create a pretty color table in red to mark failures
self.table = ColorTable(theme=PrettyTableTheme.Failure)
self.table.field_names = ["Tests Failed"]
self.table.align = "l" # <- Align the content of the table left
def print_table(self, testsummary: dict) -> None:
"""
Print the Failure Summary table
:param:
:testsummary: A dict with testname as key and failed scenarios as a list
"""
try:
for testname, testscenarios in testsummary.items():
self.table.add_row([f"{testname}:"])
for scenario in testscenarios:
self.table.add_row([f"\u2717 {scenario}"]) # <- Add unicode x mark
self.table.add_row([""]) # Add a empty row for spacing after a testname
if testsummary:
print(self.table)
except Exception as err: # pylint: disable=broad-except
print("Unable to print prettytable failure summary")
raise err
| 0 |
qxf2_public_repos/acc-model-app/tests
|
qxf2_public_repos/acc-model-app/tests/core_helpers/logging_objects.py
|
"""
Helper class for Logging Objects
"""
from utils.Base_Logging import Base_Logging
from utils.stop_test_exception_util import Stop_Test_Exception
import logging
class Logging_Objects:
def __init__(self):
self.msg_list = []
self.exceptions = []
def write_test_summary(self):
"Print out a useful, human readable summary"
self.write('\n\n************************\n--------RESULT--------\nTotal number of checks=%d'%self.result_counter)
self.write('Total number of checks passed=%d\n----------------------\n************************\n\n'%self.pass_counter)
self.write('Total number of mini-checks=%d'%self.mini_check_counter)
self.write('Total number of mini-checks passed=%d'%self.mini_check_pass_counter)
self.make_gif()
if self.gif_file_name is not None:
self.write("Screenshots & GIF created at %s"%self.screenshot_dir)
if len(self.exceptions) > 0:
self.exceptions = list(set(self.exceptions))
self.write('\n--------USEFUL EXCEPTION--------\n',level="critical")
for (i,msg) in enumerate(self.exceptions,start=1):
self.write(str(i)+"- " + msg,level="critical")
def write(self,msg,level='info', trace_back=None):
"Log the message"
msg = str(msg)
self.msg_list.append('%-8s: '%level.upper() + msg)
self.log_obj.write(msg,level,trace_back)
def success(self,msg,level='success',pre_format='PASS: '):
"Write out a success message"
self.log_obj.write(pre_format + msg,level)
self.result_counter += 1
self.pass_counter += 1
def set_log_file(self):
"set the log file"
self.log_name = self.testname + '.log'
self.log_obj = Base_Logging(log_file_name=self.log_name,level=logging.DEBUG)
def log_result(self,flag,positive,negative,level='info'):
"Write out the result of the test"
if level.lower() == "inverse":
if flag is True:
self.failure(positive,level="error")
# Collect the failed scenarios for prettytable summary
self.failed_scenarios.append(positive)
else:
self.success(negative,level="success")
else:
if flag is True:
self.success(positive,level="success")
else:
self.failure(negative,level="error")
# Collect the failed scenarios for prettytable summary
self.failed_scenarios.append(negative)
def get_failure_message_list(self):
"Return the failure message list"
return self.failure_message_list
def failure(self,msg,level='error',pre_format='FAIL: '):
"Write out a failure message"
self.log_obj.write(pre_format + msg,level)
self.result_counter += 1
self.failure_message_list.append(pre_format + msg)
if level.lower() == 'critical':
raise Stop_Test_Exception("Stopping test because: "+ msg)
def set_rp_logger(self,rp_pytest_service):
"Set the reportportal logger"
self.rp_logger = self.log_obj.setup_rp_logging(rp_pytest_service)
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.