ember-test-recorder
Version:
An Ember addon for recording and generating acceptance test cases through UI interactions
576 lines (493 loc) • 9.52 kB
CSS
/* Base styles for the test recorder */
.ember-test-recorder {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
/* Button Component */
.recorder-button {
position: fixed;
z-index: 9999;
cursor: grabbing;
user-select: none;
transition: transform 0.1s ease;
}
.recorder-svg {
width: 48px;
height: 48px;
transition: transform 0.2s ease;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}
.recorder-svg:hover {
transform: scale(1.05);
}
/* Sidebar Component */
.test-recorder-sidebar {
position: fixed;
right: 0;
top: 0;
width: 384px;
height: 100%;
background: linear-gradient(to right, #ffffff, #f8fafc);
box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
z-index: 49;
}
.sidebar-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #e5e7eb;
padding: 10px 24px;
}
.sidebar-title {
font-size: 1.5rem;
font-weight: 600;
color: #1f2937;
letter-spacing: -0.025em;
display: flex;
align-items: center;
gap: 0.5rem;
}
.sidebar-title::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
background-color: #22c55e;
border-radius: 50%;
animation: pulse-green 2s infinite;
}
.sidebar-title.recording::before {
background-color: #ef4444;
animation: pulse-red 2s infinite;
}
.close-button {
width: 32px;
height: 32px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: #6b7280;
font-size: 24px;
cursor: pointer;
transition: all 0.2s ease;
border: 1px solid transparent;
background: transparent;
}
.close-button:hover {
background-color: #f3f4f6;
color: #374151;
border-color: #e5e7eb;
}
.close-button:active {
transform: scale(0.95);
}
@keyframes pulse-green {
0% {
transform: scale(0.95);
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
}
70% {
transform: scale(1);
box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
}
100% {
transform: scale(0.95);
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
}
}
@keyframes pulse-red {
0% {
transform: scale(0.95);
box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}
70% {
transform: scale(1);
box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
}
100% {
transform: scale(0.95);
box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
}
}
.button-group {
margin-top: 2rem;
display: flex;
gap: 12px;
margin-bottom: 24px;
padding: 0 24px;
}
.record-button {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid white;
padding: 10px 16px;
border-radius: 8px;
font-weight: 500;
color: white;
cursor: pointer;
transition: all 0.2s ease;
}
.record-button.recording {
background-color: #ef4444;
}
.record-button.recording:hover {
background-color: #dc2626;
}
.record-button.not-recording {
background-color: #22c55e;
}
.record-button.not-recording:hover {
background-color: #16a34a;
}
.test-action-button {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid white;
padding: 10px 16px;
border-radius: 8px;
font-weight: 500;
color: white;
cursor: pointer;
transition: all 0.2s ease;
}
.clear-button {
background-color: #6b7280;
}
.clear-button:hover {
background-color: #4b5563;
}
.tests-container {
flex: 1;
border: 1px solid #e5e7eb;
border-radius: 8px;
margin: 0 24px;
display: flex;
flex-direction: column;
height: 65%;
max-height: 70%;
}
.tests-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
border-bottom: 1px solid #e5e7eb;
background-color: white;
position: sticky;
top: 0;
z-index: 1;
}
.tests-header-title {
font-weight: 500;
color: #374151;
}
.tests-content {
padding: 16px;
overflow-y: auto;
background-color: white;
flex: 1;
min-height: 0;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: #6b7280;
}
.test-item {
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
font-size: 14px;
line-height: 1.4;
background-color: #f9fafb;
padding: 12px;
margin-bottom: 8px;
border-radius: 8px;
border: 1px solid #e5e7eb;
white-space: pre-wrap;
}
.button-icon {
width: 1.25rem;
height: 1.25rem;
}
.tests-header-actions {
display: flex;
gap: 0.5rem;
align-items: center;
}
.test-icon-button {
background: none;
border: none;
padding: 0.5rem;
cursor: pointer;
border-radius: 0.375rem;
color: #6b7280;
display: flex;
align-items: center;
justify-content: center;
}
.test-icon-button:hover {
background-color: #f3f4f6;
color: #374151;
}
.test-icon-button.copy-button {
color: #3b82f6;
}
.test-icon-button.copy-button:hover {
background-color: #eff6ff;
color: #2563eb;
}
.test-icon-button.clear-button:hover {
background-color: #fee2e2;
color: #dc2626;
}
.assertion-mode-container {
padding: 0 24px;
margin-bottom: 24px;
}
.assertion-mode-header {
margin-bottom: 12px;
}
.assertion-mode-toggle {
display: flex;
align-items: center;
gap: 12px;
}
.toggle-switch {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #e5e7eb;
transition: .4s;
border-radius: 24px;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .toggle-slider {
background-color: #3b82f6;
}
input:checked + .toggle-slider:before {
transform: translateX(20px);
}
.toggle-label {
font-weight: 500;
color: #374151;
}
.assertion-options {
display: flex;
gap: 24px;
margin-top: 12px;
padding: 12px;
background-color: #f9fafb;
border-radius: 8px;
}
.radio-option {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
}
.radio-option input[type="radio"] {
cursor: pointer;
}
.radio-label {
color: #374151;
font-size: 14px;
}
.test-item-container {
position: relative;
display: flex;
align-items: flex-start;
gap: 8px;
padding: 12px;
background-color: #f9fafb;
border-radius: 8px;
border: 1px solid #e5e7eb;
margin-bottom: 12px;
transition: all 0.2s ease;
}
.test-item-container:hover {
border-color: #d1d5db;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.test-item {
flex: 1;
margin: 0;
background-color: transparent;
border: none;
padding: 0;
}
.remove-button {
color: #d1d5db;
background-color: #f3f4f6;
border-radius: 50%;
border: 1px solid #e5e7eb;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.7;
width: 2px;
height: 24px;
min-width: 24px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.test-item-container:hover .remove-button {
opacity: 1;
color: #9ca3af;
}
.remove-button:hover {
color: #ef4444;
background-color: #fee2e2;
border-color: #fecaca;
transform: scale(1.05);
box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}
.remove-button:active {
transform: scale(0.95);
box-shadow: 0 1px 2px rgba(239, 68, 68, 0.1);
}
.remove-button .button-icon {
width: 16px;
height: 16px;
stroke-width: 2.5px;
}
.remove-button::after {
content: 'Remove test';
position: absolute;
right: 100%;
top: 50%;
transform: translateY(-50%);
margin-right: 8px;
padding: 4px 8px;
background-color: #374151;
color: white;
border-radius: 4px;
font-size: 12px;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease;
white-space: nowrap;
}
.remove-button:hover::after {
opacity: 0.9;
}
.test-item-container:last-child {
margin-bottom: 0;
}
.sidebar-tabs {
display: flex;
padding: 0 24px;
margin-bottom: 24px;
border-bottom: 1px solid #e5e7eb;
}
.tab-button {
padding: 12px 24px;
background: none;
border: none;
border-bottom: 2px solid transparent;
color: #6b7280;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.tab-button:hover {
color: #374151;
}
.tab-button.active {
color: #3b82f6;
border-bottom-color: #3b82f6;
}
.events-config-container {
padding: 0 24px;
}
.events-header {
margin-bottom: 24px;
}
.events-header h3 {
font-size: 1.25rem;
font-weight: 600;
color: #1f2937;
margin: 0;
}
.events-header .events-description {
color: #6b7280;
font-size: 0.875rem;
}
.event-toggle-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
border: 1px solid #e5e7eb;
margin-bottom: 12px;
border-radius: 8px;
background: white;
transition: all 0.2s ease;
}
.event-toggle-item:hover {
border-color: #d1d5db;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.event-toggle-item.enabled {
border-left: 4px solid #3b82f6;
}
.event-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 4px;
}
.event-icon {
width: 24px;
height: 24px;
color: #6b7280;
}
.event-icon svg {
width: 100%;
height: 100%;
stroke-width: 1.5;
}
.enabled .event-icon {
color: #3b82f6;
}
.event-name {
font-weight: 500;
color: #374151;
}
.event-description {
font-size: 0.875rem;
color: #6b7280;
margin-left: 36px;
}
.enabled .event-name {
color: #1f2937;
}